Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update the doc of deploy kubernetes with PouchContainer #2294

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- [Features](#features)
- [Architecture](#architecture)
- [Getting Started](#getting-started)
- [Deploying Kubernetes with PouchContainer](#deploying-kubernetes-with-pouch)
- [Deploying Kubernetes with PouchContainer](#deploying-kubernetes-with-pouchcontainer)
- User Manual
- [CLI Manual](docs/commandline)
- [API Manual](docs/api)
Expand Down
11 changes: 6 additions & 5 deletions docs/kubernetes/pouch_with_kubernetes_deploying.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Deploy Kubernetes With PouchContainer

Updated: July 26th, 2018

- [Overview](#overview)
- [Prerequisite](#Prerequisite)
- [Software Version Requirement](#software-version-requirement)
Expand Down Expand Up @@ -161,8 +159,11 @@ $ sudo yum install -y kubelet-${RELEASE} kubeadm-${RELEASE} kubectl-${RELEASE}
After downloading all essential packages, there are some configurations which needs update. For kubelet, configure it to choose PouchContainer as its container runtime. Since PouchContainer makes use of a UNIX socket `unix:///var/run/pouchcri.sock`, this socket path must be delivered to kubelet. Update command is exactly the following one:

``` shell
sudo sed -i '2 i\Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=unix:///var/run/pouchcri.sock --image-service-endpoint=unix:///var/run/pouchcri.sock"' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sudo systemctl daemon-reload
$ sudo cat <<EOF > /etc/systemd/system/kubelet.service.d/0-pouch.conf
[Service]
Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=unix:///var/run/pouchcri.sock --image-service-endpoint=unix:///var/run/pouchcri.sock"
EOF
$ sudo systemctl daemon-reload
```

### Setup Kubernetes Cluster
Expand All @@ -177,7 +178,7 @@ sudo kubeadm init --pod-network-cidr 10.244.0.0/16 --ignore-preflight-errors=all

After executing the command above, Kubernetes master and kubelet are both running on this node. As a result, **a complete Kubernetes cluster on a singe node has been setup.**

Before experiencing service provided by Kubernetes, user must execute three commands **on master node** to make it:
To start using your cluster, you need to run the following as a regular user:

``` shell
mkdir -p ~/.kube
Expand Down
63 changes: 31 additions & 32 deletions docs/kubernetes/pouch_with_kubernetes_deploying_aliyun.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# Deploy Kubernetes With PouchContainer, Powered By Aliyun

Updated: 2018.6.1

- [PouchContainer deploying](#pouch-with-kubernetes-deploying)
- [PouchContainer deploying](#pouchcontainer-deploying)
- [Overview](#overview)
- [Restriction](#restriction)
- [Install and Configure](#install-and-configure)
- [Install PouchContainer](#install-pouch)
- [Install PouchContainer](#install-pouchcontainer)
- [Setup Repo](#setup-repo)
- [Install Kubernetes Components](#install-kubernetes-components)
- [Install CNI](#install-cni)
- [Using custom configurations](#using-custom-configurations)
- [Setting up the master node](#setting-up-the-master-node)
- [Setting up ImageRepository](#setting-up-imagerepository)
- [Setting up the minion nodes](#setting-up-the-minion-nodes)
- [Run and Verify](#run-and-verify)
- [Troubleshooting](#troubleshooting)

## Overview

Expand Down Expand Up @@ -46,11 +43,15 @@ You can easily setup a basic PouchContainer environment, see [INSTALLATION.md](.

On Ubuntu 16.04+:

NOTE: If you'd like to use Kubernetes 1.10+, CRI_VERSION should be "v1alpha2"
NOTE:

- If you'd like to use Kubernetes 1.10+, CRI_VERSION should be "v1alpha2"
- If you'd like to use Kubernetes 1.11+, CONTAINERD_ADDR should be "/run/containerd/containerd.sock"

```
CRI_VERSION="v1alpha1"
sed -i 's/ExecStart=\/usr\/bin\/pouchd/ExecStart=\/usr\/bin\/pouchd --enable-cri=true --cri-version=${CRI_VERSION}/g' /usr/lib/systemd/system/pouch.service
CONTAINERD_ADDR="/var/run/containerd/containerd.sock"
sed -i 's/ExecStart=\/usr\/bin\/pouchd/ExecStart=\/usr\/bin\/pouchd --enable-cri=true --cri-version=${CRI_VERSION} --containerd=${CONTAINERD_ADDR}/g' /usr/lib/systemd/system/pouch.service
systemctl daemon-reload
systemctl restart pouch
```
Expand Down Expand Up @@ -108,13 +109,6 @@ RELEASE="1.9.4-0.x86_64"
yum -y install kubelet-${RELEASE} kubeadm-${RELEASE} kubectl-${RELEASE}
```

Configure kubelet with PouchContainer as its runtime:

```sh
sed -i '2 i\Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=unix:///var/run/pouchcri.sock --image-service-endpoint=unix:///var/run/pouchcri.sock"' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
systemctl daemon-reload
```

For more details, please check [install kubelet](https://kubernetes.io/docs/setup/independent/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl).

### Install CNI
Expand All @@ -134,18 +128,33 @@ setenforce 0
yum install -y kubernetes-cni
```

### Setting up ImageRepository
### Using custom configurations

Configure kubelet with PouchContainer as its runtime:

``` shell
cat <<EOF > /etc/systemd/system/kubelet.service.d/0-pouch.conf
[Service]
Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --container-runtime-endpoint=unix:///var/run/pouchcri.sock --image-service-endpoint=unix:///var/run/pouchcri.sock"
EOF

sudo systemctl daemon-reload
```

Using custom ImageRepository

```
# cat kubeadm.conf
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
imageRepository: registry.cn-hangzhou.aliyuncs.com/google_containers
kubernetes-version: stable-1.9
kubernetesVersion: stable-1.9
networking:
podSubnet: 10.244.0.0/16
```

For more details, please check [kubeadm init](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/).

### Setting up the master node

For more detailed Kubernetes cluster installation, please check [Using kubeadm to Create a Cluster](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)
Expand All @@ -154,10 +163,12 @@ For more detailed Kubernetes cluster installation, please check [Using kubeadm t
kubeadm init --config kubeadm.conf --ignore-preflight-errors=all
```

Set the KUBECONFIG environment variable
To start using your cluster, you need to run the following as a regular user:

```sh
export KUBECONFIG=/etc/kubernetes/admin.conf
``` shell
mkdir -p ~/.kube
sudo cp -i /etc/kubernetes/admin.conf ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
```

Configure CNI network plugin with [flannel](https://github.com/coreos/flannel)
Expand Down Expand Up @@ -253,15 +264,3 @@ Commercial support is available at
</body>
</html>
```

## Troubleshooting

- Because `kubeadm` still assumes docker as the only container runtime which can be used with kubernetes. When you use `kubeadm` to initialize the master node or join the minion node to the cluster, you may encounter the following error message:`[ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`. Use the flag `--ignore-preflight-errors=all` to skip the check, like `kubeadm init --ignore-preflight-errors=all`.

- By default PouchContainer will support CRI v1alpha2,which means that using a version of Kubernetes prior to 1.10 will not work. As the NOTE mentioned above, we could start pouchd with the configuration like `pouchd --cri-version v1alpha1` to specify the version of CRI to support the version of Kubernetes below 1.10.

- By default PouchContainer will not enable the CRI. If you'd like to deploy Kubernetes with PouchContainer, you should start pouchd with the configuration like `pouchd --enable-cri`.

- By default PouchContainer will use `registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0` as the image of infra container. If you'd like use image other than that, you could start pouchd with the configuration like `pouchd --enable-cri --sandbox-image XXX`.

- Any other troubles? Make an issue to connect with us!