一、快速搭建文档

一、初始化kubernete
kubeadm init --kubernetes-version=v1.14.0  --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.10.12 --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
....
To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.10.12:6443 --token 3s24j5.nh1fqex8kmekpmtf \
    --discovery-token-ca-cert-hash sha256:62bcc3a657fd97cd6d5da14b293912234f0f14512bb4bf8d8be1023a69fc6f17
==========================
二、安装flannel网络
wget https://raw.githubusercontent.com/loverying/mykubernetes/master/kubect_install/kube-flannel.yaml
[root@master kubectyaml]# kubectl apply -f kube-flannel.yaml 
podsecuritypolicy.extensions/psp.flannel.unprivileged created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.extensions/kube-flannel-ds-amd64 created
daemonset.extensions/kube-flannel-ds-arm64 created
daemonset.extensions/kube-flannel-ds-arm created
daemonset.extensions/kube-flannel-ds-ppc64le created
daemonset.extensions/kube-flannel-ds-s390x created
[root@master kubectyaml]# kubectl get nodes
NAME     STATUS   ROLES    AGE     VERSION
master   Ready    master   2m43s   v1.14.2
三、其他机器加入集群
kubeadm join 192.168.10.12:6443 --token 3s24j5.nh1fqex8kmekpmtf \
    --discovery-token-ca-cert-hash sha256:62bcc3a657fd97cd6d5da14b293912234f0f14512bb4bf8d8be1023a69fc6f17
[root@master kubectyaml]# kubectl get nodes
NAME     STATUS   ROLES    AGE    VERSION
master   Ready    master   4m3s   v1.14.2
node01   Ready    <none>   27s    v1.14.2
node02   Ready    <none>   22s    v1.14.2
四、部署 dashboard
wget https://raw.githubusercontent.com/loverying/mykubernetes/master/kubect_install/dashboard-admin_new.yaml
wget https://raw.githubusercontent.com/loverying/mykubernetes/master/kubect_install/kubernetes-dashboard.yaml
kubectl apply -f dashboard-admin_new.yaml
kubectl apply -f kubernetes-dashboard.yaml
五、部署ingress-nginx
wget https://raw.githubusercontent.com/loverying/mykubernetes/master/kubect_install/mandatory.yaml
kubectl apply -f mandatory.yaml

六、部署应用
    1)部署pod        提供后端服务
    2)部署service   是做负载均衡
    3)部署ingress-nginx   将负载均衡绑定在域名上

七、部署普罗米修斯监控(研究)

八、日志收集平台(研究)
    EFK平台
View Code

相关文章: