Tuesday, December 31, 2019

Kubernetes: Journal

[root@k8s-master ~]# systemctl restart docker && systemctl enable docker
[root@k8s-master ~]# systemctl  restart kubelet && systemctl enable kubelet

  999  swapoff -a
 1000  yum list --showduplicates kubeadm --disableexcludes=kubernetes
 1001  yum install -y kubeadm-1.17.0-0 --disableexcludes=kubernetes
 1002  kubeadm version
 1003  kubectl drain $CP_NODE --ignore-daemonsets
 1004  kubectl get nodes
 1005  kubectl drain expc2018
 1006  kubectl describe nodes
 1007  kubectl describe nodes

 1002  export kubever=$(kubectl version | base64 | tr -d '\n')
 1003  kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"

 kubeadm token generate

kubeadm join 137.15.210.118:6443 --token ctrs8q.wr3dnzzs3awh1oz3 \
    --discovery-token-ca-cert-hash sha256:78d1e52f37983d795be38ace45f8e1fa8d0eda2c8e9316b94268ad5cf0a8e980


https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker

# Install Docker CE
## Set up the repository
### Install required packages.
yum install yum-utils device-mapper-persistent-data lvm2

### Add Docker repository.
yum-config-manager --add-repo \
  https://download.docker.com/linux/centos/docker-ce.repo

## Install Docker CE.
yum update && yum install \
  containerd.io-1.2.10 \
  docker-ce-19.03.4 \
  docker-ce-cli-19.03.4

## Create /etc/docker directory.
mkdir /etc/docker

# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}
EOF

mkdir -p /etc/systemd/system/docker.service.d

# Restart Docker
systemctl daemon-reload
systemctl restart docker

No comments:

Post a Comment