“控制器DaemonSet”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
第1行: 第1行:
 
==
 
==
 +
<pre>
 +
root@ubuntu-200470-1:~/daemonset# cat daemon.yaml
 +
apiVersion: apps/v1
 +
kind: DaemonSet
 +
metadata:
 +
  name: fluentd
 +
  namespace: logging
 +
  labels:
 +
    app: fluentd-logging
 +
spec:
 +
  selector:
 +
    matchLabels:
 +
      name: fluentd
 +
  template:
 +
    metadata:
 +
      labels:
 +
        name: fluentd
 +
    spec:
 +
      containers:
 +
      - name: fluentd-elasticsearch
 +
        image: quay.io/fluentd_elasticsearch/fluentd:v4.5.2
 +
        resources:
 +
          limits:
 +
            memory: 200Mi
 +
          requests:
 +
            cpu: 100m
 +
            memory: 200Mi
 +
        volumeMounts:
 +
        - name: varlog
 +
          mountPath: /var/log
 +
      terminationGracePeriodSeconds: 30
 +
      volumes:
 +
      - name: varlog
 +
        hostPath:
 +
          path: /var/log
 +
 +
kubectl create ns logging
 +
 +
kubectl apply -f daemon.yam
 +
 +
kubectl get daemonset -n logging
 +
NAME      DESIRED  CURRENT  READY  UP-TO-DATE  AVAILABLE  NODE SELECTOR  AGE
 +
fluentd  2        2        2      2            2          <none>          9m3s
 +
 +
 +
</pre>
  
 
=references=
 
=references=
 
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
 
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
  
 +
[https://devopscube.com/kubernetes-daemonset/ Kubernetes Daemonset: A Comprehensive Guide]
  
 
[[category:k8s]]
 
[[category:k8s]]

2023年10月6日 (五) 03:11的版本

==

root@ubuntu-200470-1:~/daemonset# cat daemon.yaml 
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: logging
  labels:
    app: fluentd-logging
spec:
  selector:
    matchLabels:
      name: fluentd
  template:
    metadata:
      labels:
        name: fluentd
    spec:
      containers:
      - name: fluentd-elasticsearch
        image: quay.io/fluentd_elasticsearch/fluentd:v4.5.2
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
      terminationGracePeriodSeconds: 30
      volumes:
      - name: varlog
        hostPath:
          path: /var/log

kubectl create ns logging

kubectl apply -f daemon.yam

 kubectl get daemonset -n logging
NAME      DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
fluentd   2         2         2       2            2           <none>          9m3s


references

https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/

Kubernetes Daemonset: A Comprehensive Guide