kubernetes集群系列资料09--daemonSet介绍

一、daemonSet案例

vim daemonSet.yaml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
    name: daemonSet-example
    labels:
        app: daemonset
spec:
    selector:
        matchLabels:
            tier: daemonSet-example     #必须与metadata.name一致,否则报错。
    template:                           #以下为嵌套pod的字段;
        metadata:
            labels:
                tier: daemonSet-example
        spec:
            containers:
            - name: daemonSet-example
              image: hub.atguigu.com/library/nginx:latest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kubectl apply -f daemonSet.yaml
kubectl get daemonset;kubectl get pod -o wide          #查看创建的daemonset及pod;
curl 10.244.1.62        #测试pod是否能提供服务;

  

posted on 2021-06-17 22:40  chalon  阅读(37)  评论(0编辑  收藏  举报