- 浏览: 2557316 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
K8S(2)Install 1.9.11 with dashboard 1.6.3 Version on EC2
On a clean machine
> sudo apt-get update && sudo apt-get install -y apt-transport-https
> curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
> echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
> sudo apt-get update
> sudo apt-get install kubelet kubeadm kubectl
> sudo swapoff -a
> cat /etc/fstab | grep -v '^#' | grep -v 'swap' | sudo tee /etc/fstab
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=52.13.38.xxx
Some configuration files
/var/lib/kubelet/kubeadm-flags.env
/var/lib/kubelet/config.yaml
/etc/kubernetes/pki
/etc/kubernetes
/etc/kubernetes/manifests
There is a timeout
> docker ps -a | grep kube | grep -v pause
> docker logs -t -f ac37e41369c6
etcdmain: listen tcp 52.13.38.xxx:2380: bind: cannot assign requested address
I may need to use the internal IP
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10251]: Port 10251 is in use
[ERROR Port-10252]: Port 10252 is in use
[ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
[ERROR Port-10250]: Port 10250 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
Pause all the Kube services
> docker ps | grep kube
> sudo rm /etc/kubernetes/manifests/kube-apiserver.yaml
> sudo rm /etc/kubernetes/manifests/kube-controller-manager.yaml
> sudo rm /etc/kubernetes/manifests/kube-scheduler.yaml
> sudo rm /etc/kubernetes/manifests/etcd.yaml
Check port number
> netstat -lnp | grep 1025
Check Service
> ps -ef | grep kube-scheduler
> ps -ef | grep kube-controller-manager
> ps -ef | grep kube
Or easily call reset
> sudo kubeadm reset
Try with the internal IP
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token byy6ys.ltasg5bxaxphjsre --discovery-token-ca-cert-hash sha256:7cdc1b6f128b394e3a16d17aa97107b38a1f095bab7eb8d7a1e78f2139315e00
It is working well this time.
> mkdir -p $HOME/.kube
> sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
> sudo chown $(id -u):$(id -g) $HOME/.kube/config
> kubectl get nodes
NAME STATUS ROLES AGE VERSION
Ip-172-31-41-xxx NotReady master 2m35s v1.13.3
Check the services
> kubectl get pod -n kube-system -o wide
Apply network
> kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/rbac.yaml
> kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/canal.yaml
Enable run on master
> kubectl taint nodes --all node-role.kubernetes.io/master-
Admin Dashboard
> kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
Proxy on that service
> kubectl proxy --address='0.0.0.0' --accept-hosts='^*$
Or add a port number
> kubectl proxy --address='0.0.0.0' --port='49003' --accept-hosts='^*$'
Visit the UI
http://webapi-dev.sillycat.com:49003/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
Here is the steps I create user
> cat admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
> kubectl create -f ./admin-user.yaml
> cat admin-user-role-binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kube-system
> kubectl create -f ./admin-user-role-binding.yaml
Check the token
> kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
It seems the login is success, but I still stay in the login page.
Here is the logging from dashboard
2019-02-13T23:54:57.238575753Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:54:57.313761682Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Incoming HTTP/2.0 POST /api/v1/login request from 172.31.41.xxx:39628: { contents hidden }
2019-02-13T23:54:57.318339951Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:54:57.386075554Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Incoming HTTP/2.0 GET /api/v1/login/status request from 172.31.41.xxx:39628: {}
2019-02-13T23:54:57.386344896Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:55:03.733811743Z 2019/02/13 23:55:03 Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in 30 seconds.
Solution:
Check pod
> kubectl get pod -n kube-system -o wide
Check pod with namespace
> kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system canal-jc7g7 3/3 Running 0 24m
kube-system coredns-86c58d9df4-7zmkm 1/1 Running 0 29m
kube-system coredns-86c58d9df4-d76gk 1/1 Running 0 29m
kube-system etcd-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-apiserver-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-controller-manager-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-proxy-hdn4m 1/1 Running 0 29m
kube-system kube-scheduler-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kubernetes-dashboard-57df4db6b-2fnct 1/1 Running 0 22m
Check logging
> kubectl logs kubernetes-dashboard-57df4db6b-2fnct -n kube-system
Try a new URL
http://webapi-dev.sillycat.com:49003/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/namespace?namespace=default
2019-02-14T00:14:17.762780910Z 2019/02/14 00:14:17 http: TLS handshake error from 172.31.41.xxx:50124: tls: first record does not look like a TLS handshake
So the Heapster is gone
> kubectl cluster-info
Kubernetes master is running at https://172.31.41.xxx:6443
KubeDNS is running at https://172.31.41.xxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Check my version
> kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
It may work in version https://github.com/kubernetes-retired/heapster/blob/master/docs/deprecation.md Kubernetes 1.11
Remove the dashboard
> kubectl --namespace kube-system delete deployment kubernetes-dashboard
I may need to roll back some versions
https://github.com/kubernetes/dashboard/releases
Version List
https://github.com/kubernetes/kubernetes/releases
> sudo kubeadm init --kubernetes-version=v1.10.13 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
this version of kubeadm only supports deploying clusters with the control plane version >= 1.12.0. Current version: v1.10.13
Install one older version
> sudo kubeadm init --kubernetes-version=v1.12.5 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx --ignore-preflight-errors=KubeletVersion
kubeadm join 172.31.41.xxx:6443 --token pj9784.x0g7x6g7jsn15qx0 --discovery-token-ca-cert-hash sha256:4ab96813d9e7824f281afd5223f6030eb6748bca539ff6a5b9f4b63001c978f9
Install older version kubeadm
https://stackoverflow.com/questions/49721708/how-to-install-specific-version-of-kubernetes
Remove the new versions
> sudo apt-get remove kubelet
> sudo apt-get remove kubectl
> sudo apt-get remove kubeadm
Check this
https://blog.csdn.net/liukuan73/article/details/83090350
https://www.cnblogs.com/Irving/p/9818440.html
https://www.kubernetes.org.cn/4619.html
> sudo apt-get install -y kubeadm=1.12\* kubectl=1.12\* kubelet=1.12\*
> kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.5", GitCommit:"51dd616cdd25d6ee22c83a858773b607328a18ec", GitTreeState:"clean", BuildDate:"2019-01-16T18:21:46Z", GoVersion:"go1.10.7", Compiler:"gc", Platform:"linux/amd64"}
>sudo kubeadm init --kubernetes-version=v1.12.5 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token bz5oex.zxxcb2kmo0y71wif --discovery-token-ca-cert-hash sha256:88a20d8c192df9e68e5881977549a63cbee5a1bc73cd9d023be291a71564c97c
Visit the page
http://webapi-dev.cloudsnap.com:49003/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
> sudo apt-get install -y kubeadm=1.10\* kubectl=1.10\* kubelet=1.10\*
> kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.13", GitCommit:"954ff68d59e9dc62fa8252ffa9023a90ff8a358c", GitTreeState:"clean", BuildDate:"2019-02-13T11:03:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
>sudo kubeadm init --kubernetes-version=v1.10.13 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token 13e6na.gbhit54jartozbfa --discovery-token-ca-cert-hash sha256:3a83299867fb2337d256e4269614981124abf7400235c6a54010c1db58cf3a09
Add Parameters to skip
> wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
> kubectl apply -f ./kubernetes-dashboard.yaml
args:
- --auto-generate-certificates
- --enable-skip-login
Older Version 1.9
>sudo apt-get install -y kubeadm=1.9\* kubectl=1.9\* kubelet=1.9\*
>sudo kubeadm init --kubernetes-version=v1.9.11 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
An Old Version is working 1.6.3
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml
http://webapi-dev.cloudsnap.com:49003/api/v1/namespaces/kube-system/services/kubernetes-dashboard:/proxy/#!/overview?namespace=default
Try to deploy nginx on K8S
> kubectl create deployment nginx --image=nginx
deployment "nginx" created
> kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
nginx 1 1 1 1 26s
Check details
> kubectl describe deployment nginx
Create the Service
> kubectl create service nodeport nginx --tcp=80:80
service "nginx" created
> kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 19m
nginx NodePort 10.105.171.65 <none> 80:32062/TCP 38s
Or
> kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 41m
nginx LoadBalancer 10.107.141.177 <pending> 80:32639/TCP 2m
We can curl the Cluster IP
> kubectl create service loadbalancer nginx --tcp=80:80
List all services
> kubectl get service
Delete one service
> kubectl delete svc nginx
List deployments
> kubectl get deployments
Delete deployment
> kubectl delete deployments nginx
deployment "nginx" deleted
Command Details
http://docs.kubernetes.org.cn/564.html
References:
https://github.com/kubernetes/kubeadm/issues/339
https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above
https://stackoverflow.com/questions/49721708/how-to-install-specific-version-of-kubernetes
On a clean machine
> sudo apt-get update && sudo apt-get install -y apt-transport-https
> curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
> echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
> sudo apt-get update
> sudo apt-get install kubelet kubeadm kubectl
> sudo swapoff -a
> cat /etc/fstab | grep -v '^#' | grep -v 'swap' | sudo tee /etc/fstab
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=52.13.38.xxx
Some configuration files
/var/lib/kubelet/kubeadm-flags.env
/var/lib/kubelet/config.yaml
/etc/kubernetes/pki
/etc/kubernetes
/etc/kubernetes/manifests
There is a timeout
> docker ps -a | grep kube | grep -v pause
> docker logs -t -f ac37e41369c6
etcdmain: listen tcp 52.13.38.xxx:2380: bind: cannot assign requested address
I may need to use the internal IP
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10251]: Port 10251 is in use
[ERROR Port-10252]: Port 10252 is in use
[ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
[ERROR FileAvailable--etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
[ERROR Port-10250]: Port 10250 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
Pause all the Kube services
> docker ps | grep kube
> sudo rm /etc/kubernetes/manifests/kube-apiserver.yaml
> sudo rm /etc/kubernetes/manifests/kube-controller-manager.yaml
> sudo rm /etc/kubernetes/manifests/kube-scheduler.yaml
> sudo rm /etc/kubernetes/manifests/etcd.yaml
Check port number
> netstat -lnp | grep 1025
Check Service
> ps -ef | grep kube-scheduler
> ps -ef | grep kube-controller-manager
> ps -ef | grep kube
Or easily call reset
> sudo kubeadm reset
Try with the internal IP
> sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token byy6ys.ltasg5bxaxphjsre --discovery-token-ca-cert-hash sha256:7cdc1b6f128b394e3a16d17aa97107b38a1f095bab7eb8d7a1e78f2139315e00
It is working well this time.
> mkdir -p $HOME/.kube
> sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
> sudo chown $(id -u):$(id -g) $HOME/.kube/config
> kubectl get nodes
NAME STATUS ROLES AGE VERSION
Ip-172-31-41-xxx NotReady master 2m35s v1.13.3
Check the services
> kubectl get pod -n kube-system -o wide
Apply network
> kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/rbac.yaml
> kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal/canal.yaml
Enable run on master
> kubectl taint nodes --all node-role.kubernetes.io/master-
Admin Dashboard
> kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
Proxy on that service
> kubectl proxy --address='0.0.0.0' --accept-hosts='^*$
Or add a port number
> kubectl proxy --address='0.0.0.0' --port='49003' --accept-hosts='^*$'
Visit the UI
http://webapi-dev.sillycat.com:49003/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
Here is the steps I create user
> cat admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
> kubectl create -f ./admin-user.yaml
> cat admin-user-role-binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kube-system
> kubectl create -f ./admin-user-role-binding.yaml
Check the token
> kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
It seems the login is success, but I still stay in the login page.
Here is the logging from dashboard
2019-02-13T23:54:57.238575753Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:54:57.313761682Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Incoming HTTP/2.0 POST /api/v1/login request from 172.31.41.xxx:39628: { contents hidden }
2019-02-13T23:54:57.318339951Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:54:57.386075554Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Incoming HTTP/2.0 GET /api/v1/login/status request from 172.31.41.xxx:39628: {}
2019-02-13T23:54:57.386344896Z 2019/02/13 23:54:57 [2019-02-13T23:54:57Z] Outcoming response to 172.31.41.xxx:39628 with 200 status code
2019-02-13T23:55:03.733811743Z 2019/02/13 23:55:03 Metric client health check failed: the server could not find the requested resource (get services heapster). Retrying in 30 seconds.
Solution:
Check pod
> kubectl get pod -n kube-system -o wide
Check pod with namespace
> kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system canal-jc7g7 3/3 Running 0 24m
kube-system coredns-86c58d9df4-7zmkm 1/1 Running 0 29m
kube-system coredns-86c58d9df4-d76gk 1/1 Running 0 29m
kube-system etcd-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-apiserver-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-controller-manager-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kube-proxy-hdn4m 1/1 Running 0 29m
kube-system kube-scheduler-ip-172-31-41-xxx 1/1 Running 0 28m
kube-system kubernetes-dashboard-57df4db6b-2fnct 1/1 Running 0 22m
Check logging
> kubectl logs kubernetes-dashboard-57df4db6b-2fnct -n kube-system
Try a new URL
http://webapi-dev.sillycat.com:49003/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/namespace?namespace=default
2019-02-14T00:14:17.762780910Z 2019/02/14 00:14:17 http: TLS handshake error from 172.31.41.xxx:50124: tls: first record does not look like a TLS handshake
So the Heapster is gone
> kubectl cluster-info
Kubernetes master is running at https://172.31.41.xxx:6443
KubeDNS is running at https://172.31.41.xxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Check my version
> kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
It may work in version https://github.com/kubernetes-retired/heapster/blob/master/docs/deprecation.md Kubernetes 1.11
Remove the dashboard
> kubectl --namespace kube-system delete deployment kubernetes-dashboard
I may need to roll back some versions
https://github.com/kubernetes/dashboard/releases
Version List
https://github.com/kubernetes/kubernetes/releases
> sudo kubeadm init --kubernetes-version=v1.10.13 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
this version of kubeadm only supports deploying clusters with the control plane version >= 1.12.0. Current version: v1.10.13
Install one older version
> sudo kubeadm init --kubernetes-version=v1.12.5 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx --ignore-preflight-errors=KubeletVersion
kubeadm join 172.31.41.xxx:6443 --token pj9784.x0g7x6g7jsn15qx0 --discovery-token-ca-cert-hash sha256:4ab96813d9e7824f281afd5223f6030eb6748bca539ff6a5b9f4b63001c978f9
Install older version kubeadm
https://stackoverflow.com/questions/49721708/how-to-install-specific-version-of-kubernetes
Remove the new versions
> sudo apt-get remove kubelet
> sudo apt-get remove kubectl
> sudo apt-get remove kubeadm
Check this
https://blog.csdn.net/liukuan73/article/details/83090350
https://www.cnblogs.com/Irving/p/9818440.html
https://www.kubernetes.org.cn/4619.html
> sudo apt-get install -y kubeadm=1.12\* kubectl=1.12\* kubelet=1.12\*
> kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.5", GitCommit:"51dd616cdd25d6ee22c83a858773b607328a18ec", GitTreeState:"clean", BuildDate:"2019-01-16T18:21:46Z", GoVersion:"go1.10.7", Compiler:"gc", Platform:"linux/amd64"}
>sudo kubeadm init --kubernetes-version=v1.12.5 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token bz5oex.zxxcb2kmo0y71wif --discovery-token-ca-cert-hash sha256:88a20d8c192df9e68e5881977549a63cbee5a1bc73cd9d023be291a71564c97c
Visit the page
http://webapi-dev.cloudsnap.com:49003/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
> sudo apt-get install -y kubeadm=1.10\* kubectl=1.10\* kubelet=1.10\*
> kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.13", GitCommit:"954ff68d59e9dc62fa8252ffa9023a90ff8a358c", GitTreeState:"clean", BuildDate:"2019-02-13T11:03:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
>sudo kubeadm init --kubernetes-version=v1.10.13 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
kubeadm join 172.31.41.xxx:6443 --token 13e6na.gbhit54jartozbfa --discovery-token-ca-cert-hash sha256:3a83299867fb2337d256e4269614981124abf7400235c6a54010c1db58cf3a09
Add Parameters to skip
> wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
> kubectl apply -f ./kubernetes-dashboard.yaml
args:
- --auto-generate-certificates
- --enable-skip-login
Older Version 1.9
>sudo apt-get install -y kubeadm=1.9\* kubectl=1.9\* kubelet=1.9\*
>sudo kubeadm init --kubernetes-version=v1.9.11 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=172.31.41.xxx
An Old Version is working 1.6.3
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml
http://webapi-dev.cloudsnap.com:49003/api/v1/namespaces/kube-system/services/kubernetes-dashboard:/proxy/#!/overview?namespace=default
Try to deploy nginx on K8S
> kubectl create deployment nginx --image=nginx
deployment "nginx" created
> kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
nginx 1 1 1 1 26s
Check details
> kubectl describe deployment nginx
Create the Service
> kubectl create service nodeport nginx --tcp=80:80
service "nginx" created
> kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 19m
nginx NodePort 10.105.171.65 <none> 80:32062/TCP 38s
Or
> kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 41m
nginx LoadBalancer 10.107.141.177 <pending> 80:32639/TCP 2m
We can curl the Cluster IP
> kubectl create service loadbalancer nginx --tcp=80:80
List all services
> kubectl get service
Delete one service
> kubectl delete svc nginx
List deployments
> kubectl get deployments
Delete deployment
> kubectl delete deployments nginx
deployment "nginx" deleted
Command Details
http://docs.kubernetes.org.cn/564.html
References:
https://github.com/kubernetes/kubeadm/issues/339
https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above
https://stackoverflow.com/questions/49721708/how-to-install-specific-version-of-kubernetes
发表评论
-
Update Site will come soon
2021-06-02 04:10 1683I am still keep notes my tech n ... -
Stop Update Here
2020-04-28 09:00 320I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 482NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 373Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 373Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 341Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 433Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 441Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 379Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 461VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 391Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 482NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 428Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 340Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 252GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 454GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 330GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 316Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 323Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 298Serverless with NodeJS and Tenc ...
相关推荐
2. 提高性能:每个版本的Ant都会努力优化其执行速度,1.9.11也不例外,可能会有更高效的文件操作和任务执行。 3. 任务增强:可能增加了新的任务或者改进了现有任务的行为,以便更好地适应现代开发环境的需求。 4. ...
MX Player Pro v1.9.11 Cracked APK
2. 预编译检查:在安装驱动前,需要确保系统满足必要的依赖条件,例如GCC编译器、kernel-devel包等。可以使用`yum install kernel-devel gcc`命令来安装这些依赖。 3. 编译驱动:进入解压后的驱动源码目录,执行`...
1.9.11前配置 ./configure --prefix=/opt/nginx-1.9.11 --add-module=/你的目录位置/fastdfs-nginx-module-master/src --with-http_ssl_module --with-stream 然后再make & make install ,最后在nginx-1.9.11/conf/...
这个"jackson-all-1.9.11.jar.zip"压缩包包含的是Jackson库的一个集合版本,版本号为1.9.11。在Web开发中,JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,常用于服务器与客户端之间传输数据,因为...
随着技术的发展,虽然现在更推荐使用更新的Jackson版本(如2.x或3.x系列),但了解`jackson-all-1.9.11.jar`在历史上的作用和使用方式,对于理解JSON处理在Java Web开发中的重要性仍然非常有益。
标题中的"apache-ant-1.9.11-bin.tar.gz"是一个包含Apache Ant 1.9.11版本的二进制压缩包,通常用于Linux或Mac OS X系统,因为它们支持tar和gzip格式。这个压缩包包含了运行和使用Apache Ant所需的全部文件。 在...
2. SQL命令区:这是执行SQL查询的地方。你可以在此输入任何合法的SQL语句,如SELECT、INSERT、UPDATE、DELETE等,点击“Execute”按钮即可执行。SQLiteSpy支持自动完成,有助于快速编写SQL语句。 3. 结果集展示区:...
开源软件 jack audio 1.9.11版本。
TestLink用于进行测试过程中的管理,通过使用TestLink提供的功能,可以将测试过程从测试需求、测试设计、到测试执行完整的管理起来,同时,它还提供了好多种测试结果的统计和分析,使我们能够简单的开始测试工作和...
《Battery Guru 电池大师v1.9.11高级版》是一款专为手机用户设计的电池管理应用,旨在帮助用户优化电池使用,延长设备的续航时间。在这个版本中,我们看到的是v1.9.11的高级版,通常这意味着它包含了一些额外的功能...
稳定nginx稳定nginx稳定nginx稳定nginx稳定nginx稳定nginx稳定nginx稳定nginx稳定nginx
xray 是一款功能强大的安全评估工具,由多名经验丰富的一线安全从业者呕心打造而成,主要特性有: 检测速度快。发包速度快; 漏洞检测算法效率高。 支持范围广。大至 OWASP Top 10 通用漏洞检测,小至各种 CMS 框架 ...
<version>1.9.11</version> ``` 然后,你需要配置Spring MVC的`DispatcherServlet`以启用JSON支持。在Spring的配置文件中(如`dispatcher-servlet.xml`),添加以下配置: ```xml ``` 在这个配置中...
《Jackson-Mapper-Asl-1.9.11.jar:JSON处理的高效工具》 在Java开发领域,数据序列化和反序列化是至关重要的环节,Jackson库就是一款广泛使用的JSON处理框架,其中`jackson-mapper-asl-1.9.11.jar`是Jackson的一个...
黑莓瑞士军刀:黑莓cod软件安装与管理,黑莓刷机助手。 BBSAK是一款黑莓综合小软件,相当于一个小型的桌面管理...下载后先双击安装ChineseSimp.exe,完毕后再继续双击安装BBSAKv1.9.11_Installer.msi汉化包即可使用。
TRichView.v1.9.11是一款专为DELPHI开发者设计的高级文本编辑控件,它在编程环境中提供了丰富的功能,使开发者能够轻松处理和展示富文本格式(RTF)。这款控件不仅支持基本的文本编辑操作,还具备与数据库交互的能力...
《Xray 1.9.11:渗透测试利器详解》 Xray 1.9.11是一款功能强大的渗透测试工具,专为网络安全领域的专业人士设计。渗透测试,也称为白盒测试或道德黑客攻击,是一种通过模拟恶意黑客攻击来评估系统安全性的合法手段...
geth1.9.11源码。