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 kubernetes deploying document #1917

Merged

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun [email protected]

Ⅰ. Describe what this PR did

We have lots of users who are using Kubernetes to be deployed with PouchContainer. Then I think we need to update the Kubernetes install documents.

I did two things:

  • split the troubleshooting part from the raw file to be a single one;
  • Update the new structure of the document:
  • [Overview
  • [Prerequisite]
    • [Software Version Requirement]
    • [Node Resource Requirement]
  • [Install and Configure PouchContainer]
    • [Install PouchContainer]
    • [Configure PouchContainer]
    • [Restart PouchContainer]
    • [Verify PouchContainer Correctness]
  • [Install and Configure Kubernetes]
    • [Download Kubernets Packages]
    • [Configure Kubernetes Component]
    • [Setup Kubernetes Cluster]
    • [Verify Kubernetes Correctness]
  • [Setup CNI network]
    • [flannel]
    • [Calico]

Ⅱ. Does this pull request fix one issue?

none

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

@codecov-io
Copy link

codecov-io commented Jul 26, 2018

Codecov Report

Merging #1917 into master will decrease coverage by 0.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1917      +/-   ##
==========================================
- Coverage   62.64%   62.43%   -0.22%     
==========================================
  Files         200      200              
  Lines       15567    15567              
==========================================
- Hits         9752     9719      -33     
- Misses       4567     4595      +28     
- Partials     1248     1253       +5
Flag Coverage Δ
#criv1alpha1test 33.24% <ø> (-0.02%) ⬇️
#criv1alpha2test 33.74% <ø> (ø) ⬆️
#integrationtest 37.58% <ø> (-0.38%) ⬇️
#unittest 20.48% <ø> (ø) ⬆️
Impacted Files Coverage Δ
daemon/containerio/hijack_conn.go 77.14% <0%> (-11.43%) ⬇️
daemon/containerio/container_io.go 69.61% <0%> (-4.98%) ⬇️
pkg/meta/store.go 54.76% <0%> (-4.77%) ⬇️
daemon/containerio/options.go 76.19% <0%> (-4.77%) ⬇️
daemon/mgr/container_utils.go 56.27% <0%> (-1.74%) ⬇️
daemon/mgr/system.go 73.27% <0%> (-1.73%) ⬇️
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
cri/v1alpha1/cri.go 65.04% <0%> (-0.19%) ⬇️
daemon/mgr/container.go 53.85% <0%> (-0.16%) ⬇️

|Kubernetes|1.10.0+|
|PouchContainer|1.0.0-rc1+|
|CNI|0.6.0+|
|OS Distribution|entOS 7.0+ or Ubuntu 16.04 +|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/entOS/CentOS


### Node Resource Requirement

To make Kubernete run stably, we should provide sufficient resource for node(s) in Kubernetes. Currently we list two kinds of deploying mode:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Kubernete/Kubernetes

@allencloud allencloud force-pushed the update-k8s-deploy-doc branch 2 times, most recently from cbffe36 to 96d770c Compare July 27, 2018 01:57
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
After installing and configuring PouchContainer to make it ready for Kubernete, validation work could be made to verify if the pouchd meets the requirement.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Kubernete/Kubernetes

RELEASE="1.9.4-0.x86_64"
yum install -y kubelet-${RELEASE} kubeadm-${RELEASE} kubectl-${RELEASE}
```
After setting up kubelet's configuration, the next step is installing Kubernetes master node. When using kubeadmin to initialize master node, a CIDR address should be provided. CIDR address is an allocated IP range dedicated for pod's network. Please do not make this IP range conflict or overlapped with the undelying network environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/kubeadmin/kubeadm


kubeadm join --token $token ${master_ip:port} --discovery-token-ca-cert-hash $ca-cert
```
If your environment cannot access internete, please make sure to store content of file above to local directory. Then `kubectl create -f kube-flannel.yml` can make it setup flannel network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/internete/internet

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

### Install CNI
After executing the command above, Kubernete master and kubelet are both running on this node. As a result, **a complete Kubernete cluster on singe node has been setup.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Kubernete/Kubernetes

@allencloud allencloud force-pushed the update-k8s-deploy-doc branch from 96d770c to 21fe81d Compare July 27, 2018 02:16
@allencloud
Copy link
Collaborator Author

Thanks for your review @starnop 👏


- Download Kubernetes Packages
- Configure Kubernetes Component;
- Intialize Kubernetes Master Node;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intialize -> Initialize


No matter running Kubernetes in a single node or in a cluster, PouchContainer is the underlying container engine which should be ready first. After that, Kubernetes components should be installed and configured on corresponding nodes.

Kubernetes parts includes three parts:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--> Kubernetes part also includes three steps

It seems more smoothly 😄

```

NOTE: For other plugins, please check [Installing a pod network](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network).
Network in Kubernetes cluster is very decoupled work when deploying Kubernetes. In kubernetes community, CNI plugin is a wide-spread way to setup network for pods. Fully test CNI plugins in Kubernetes with PouchContainer are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

---> In Kubernetes community


### Download Kubernetes Packages

When installing Kubernetes, we use [kubeadm](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/) to create Kubernetes cluster. First step is to download essential packages from software repository. Thus, we need to add kubernetes.io to debian package source for Ubuntu series and also for CentOS series. After setting up source repository, three kubernetes components will be downloaded:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--> three Kubernetes components

@allencloud allencloud force-pushed the update-k8s-deploy-doc branch from 21fe81d to aa25321 Compare July 27, 2018 06:04
@allencloud
Copy link
Collaborator Author

Thanks for your review 🍻 @YaoZengzeng
Updated.

@allencloud
Copy link
Collaborator Author

@YaoZengzeng @starnop PTAL

@YaoZengzeng
Copy link
Contributor

LGTM

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

### Install CNI
After executing the command above, Kubernetes master and kubelet are both running on this node. As a result, **a complete Kubernete cluster on singe node has been setup.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Kubernete/Kubernetes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on single node --> on a single node


## Overview

This document shows how to easily install a Kubernetes cluster with PouchContainer as the container runtime.For Chinese customer, it's might be faster and easier to download Kubernetes components and various kinds of container images from Aliyun [Kubernetes + PouchContainer + Aliyun](pouch_with_kubernetes_deploying_aliyun.md).
This document shows how to easily install a Kubernetes cluster with PouchContainer as the container runtime. For Chinese customer, it's might be faster and easier to download Kubernetes components and various kinds of container images from Aliyun [Kubernetes + PouchContainer + Aliyun](pouch_with_kubernetes_deploying_aliyun.md).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Chinese customer --> For a Chinese customer
it's might be --> it might be


NOTE: PouchContainer version prior to 0.5.x (including version 0.5.0) did not support configuring CNI network plugin with flannel. If you want to do that, use the latest code from the branch of master, refer to [Developer Quick-Start](https://github.com/alibaba/pouch/blob/master/INSTALLATION.md#developer-quick-start)
Before installing Kubernetes and PouchContainer to provide orchestrating service for users, some environment requirement must meet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must meet --> must be met


## Install and Configure Kubernetes

No matter running Kubernetes in a single node or in a cluster, PouchContainer is the underlying container engine which should be ready first. After that, Kubernetes components should be installed and configured on corresponding nodes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a single node --> on a single node


When installing Kubernetes, we use [kubeadm](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/) to create Kubernetes cluster. First step is to download essential packages from software repository. Thus, we need to add kubernetes.io to debian package source for Ubuntu series and also for CentOS series. After setting up source repository, three Kubernetes components will be downloaded:

- [kubelet](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/): a primary node agent runs on each node in Kubernetes Clusters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make context consistently, change on each node in Kubernetes Clusters to on each node in Kubernetes clusters.

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

### Install CNI
After executing the command above, Kubernetes master and kubelet are both running on this node. As a result, **a complete Kubernete cluster on singe node has been setup.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on single node --> on a single node

@allencloud allencloud force-pushed the update-k8s-deploy-doc branch from aa25321 to 17df581 Compare July 31, 2018 13:36
@allencloud
Copy link
Collaborator Author

Thanks for all your reviews. I will merge this first. If you have any other opinions, please feel free to let me know.

@allencloud allencloud merged commit f590a6d into AliyunContainerService:master Jul 31, 2018
@allencloud allencloud deleted the update-k8s-deploy-doc branch July 31, 2018 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants