Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Fix for kube-up.sh and update several documments.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <[email protected]>
  • Loading branch information
Random-Liu committed Mar 20, 2018
1 parent 013ab03 commit 904938f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ uninstall:
rm -f $(BINDIR)/ctr

$(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) ./hack/release.sh
@BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/release.sh

release: $(BUILD_DIR)/$(TARBALL)

Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ curl -f --ipv4 -Lo "${TARBALL}" --connect-timeout 20 --max-time 300 --retry 6 --
tar xvf "${TARBALL}"

# Copy crictl config.
cp "${CRI_CONTAINERD_HOME}/etc/crictl.yaml" /etc
cp "${CONTAINERD_HOME}/etc/crictl.yaml" /etc

echo "export PATH=${CONTAINERD_HOME}/usr/local/bin/:${CONTAINERD_HOME}/usr/local/sbin/:\$PATH" > \
/etc/profile.d/containerd_env.sh
9 changes: 4 additions & 5 deletions cluster/gce/env
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ 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.
if [ -z "${CRI_CONTAINERD_VERSION:-}" ]; then
CRI_CONTAINERD_VERSION=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
https://storage.googleapis.com/cri-containerd-release/latest)
version_file=${GCE_DIR}/../version
if [ ! -f "${version_file}" ]; then
echo "version file does not exist"
exit 1
fi
version_file=$(mktemp /tmp/version.XXXX)
echo "${CRI_CONTAINERD_VERSION}" > "$version_file"
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
export KUBE_CONTAINER_RUNTIME="remote"
Expand Down
3 changes: 2 additions & 1 deletion docs/crictl.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ $ docker pull k8s.gcr.io/pause-amd64:3.1
Status: Downloaded newer image for k8s.gcr.io/pause-amd64:3.1
$ docker save k8s.gcr.io/pause-amd64:3.1 -o pause.tar
```
Then load the container image into the container runtime:
Then use [`ctr`](https://github.com/containerd/containerd/blob/master/docs/man/ctr.1.md)
to load the container image into the container runtime:
```console
$ sudo ctr cri load pause.tar
Loaded image: k8s.gcr.io/pause-amd64:3.1
Expand Down
8 changes: 3 additions & 5 deletions docs/kube-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ Unpack release tarball to any directory, using `${CRI_CONTAINERD_PATH}` to indic
tar -C ${CRI_CONTAINERD_PATH} -xzf cri-containerd-${VERSION}.linux-amd64.tar.gz
```
## Set Environment Variables for CRI-Containerd
Use environment variable `CRI_CONTAINERD_VERSION` to specify `cri-containerd` version. By default,
latest version will be used.
```bash
. ${CRI_CONTAINERD_PATH}/opt/cri-containerd/cluster/gce/env
. ${CRI_CONTAINERD_PATH}/opt/containerd/cluster/gce/env
```
## Create Kubernetes Cluster on GCE
Follow these instructions [here](https://kubernetes.io/docs/getting-started-guides/gce/) to create a production quality Kubernetes cluster on GCE.

**Make sure the Kubernetes version you are using is v1.9 or greater:**
**Make sure the Kubernetes version you are using is v1.10 or greater:**
* When using `https://get.k8s.io`, use the environment variable `KUBERNETES_RELEASE` to set version.
* When using a Kubernetes release tarball, make sure to select version 1.9 or greater.
* When using a Kubernetes release tarball, make sure to select version 1.10 or greater.
7 changes: 7 additions & 0 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ CUSTOM_CONTAINERD=${CUSTOM_CONTAINERD:-false}

destdir=${BUILD_DIR}/release-stage

if [[ -z "${VERSION}" ]]; then
echo "VERSION is not set"
exit 1
fi

# Remove release-stage directory to avoid including old files.
rm -rf ${destdir}

Expand All @@ -50,6 +55,8 @@ cp ${ROOT}/contrib/systemd-units/* ${destdir}/etc/systemd/system/
# Install cluster directory into release stage.
mkdir -p ${destdir}/opt/containerd
cp -r ${ROOT}/cluster ${destdir}/opt/containerd
# Write a version file into the release tarball.
echo ${VERSION} > ${destdir}/opt/containerd/cluster/version

# Create release tar
tarball=${BUILD_DIR}/${TARBALL}
Expand Down

0 comments on commit 904938f

Please sign in to comment.