#!/bin/bash
GCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# TODO(random-liu): Upload release tarball to user's own GCS, and use it. We should
# not let all nodes of all users download tarball from cri-containerd-release.
version_file=${GCE_DIR}/../version
if [ ! -f "${version_file}" ]; then
  echo "version file does not exist"
  exit 1
fi
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}"
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}"
export KUBE_CONTAINER_RUNTIME="remote"
export KUBE_CONTAINER_RUNTIME_ENDPOINT="unix:///run/containerd/containerd.sock"
export KUBE_CONTAINER_RUNTIME_NAME=containerd
export KUBE_LOAD_IMAGE_COMMAND="/home/containerd/usr/local/bin/ctr -n=k8s.io images import"
export NETWORK_PROVIDER=""
export NON_MASQUERADE_CIDR="0.0.0.0/0"
export KUBE_KUBELET_EXTRA_ARGS="--runtime-cgroups=/system.slice/containerd.service"
export KUBE_FEATURE_GATES="ExperimentalCriticalPodAnnotation=true,CRIContainerLogRotation=true"
