美文网首页
k8s学习小记

k8s学习小记

作者: FredricZhu | 来源:发表于2019-07-28 17:49 被阅读0次

1.Kubectl创建Deployment的过程


image.png
kubectl run nginx-deployment --image=nginx:1.7.9 --replicas=2
kubectl get replicaset
kubectl describe replicaset nginx-deployment-7c7d6486fc
kuebctl get  pods
kubectl describe pod nginx-deployment-7c7d6486fc-btwcd

2.nginx-deployment配置文件。

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    run: nginx-deployment
  name: nginx-deployment
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      run: nginx-deployment
  template:
    metadata:
      labels:
        run: nginx-deployment
    spec:
      containers:
      - image: nginx:1.7.9
        imagePullPolicy: IfNotPresent
        name: nginx-deployment
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      restartPolicy: Always

kubectl apply -f file.yaml
niginx-deployment配置文件简介,


image.png

3.将master作为node用来调度,解除master限制。


image.png

4.FailOver(k8s失败重试机制)


image.png image.png image.png

5.用label控制pod的位置


image.png
image.png
image.png
image.png image.png

相关文章

网友评论

      本文标题:k8s学习小记

      本文链接:https://www.haomeiwen.com/subject/qyhprctx.html