OpenShift DaemonSet Definition: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * OpenShift Configuration =Definition= <syntaxhighlight lang='yaml'> oc get -o yaml daemonset/logging-fluentd apiVersion: extensions/v1beta1 kind: DaemonSet...")
 
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[OpenShift Configuration]]
* [[OpenShift Configuration]]
* [[OpenShift DaemonSet Concepts|DaemonSet Concepts]]
=Overview=
The <tt>.spec.template</tt> is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.
The pod template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Always.


=Definition=
=Definition=


<syntaxhighlight lang='yaml'>
apiVersion: extensions/v1beta1
oc get -o yaml daemonset/logging-fluentd
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
kind: DaemonSet
  creationTimestamp: 2017-11-11T08:16:24Z
metadata:
  generation: 1
  creationTimestamp: 2017-11-11T08:16:24Z
  labels:
  generation: 1
    component: fluentd
  labels:
    logging-infra: fluentd
    component: fluentd
    provider: openshift
    logging-infra: fluentd
  name: logging-fluentd
    provider: openshift
  namespace: logging
  name: logging-fluentd
  resourceVersion: "2865410"
  namespace: logging
  selfLink: /apis/extensions/v1beta1/namespaces/logging/daemonsets/logging-fluentd
  resourceVersion: "2865410"
  uid: 9b95bf05-c6b8-11e7-9f09-525400360e56
  selfLink: /apis/extensions/v1beta1/namespaces/logging/daemonsets/logging-fluentd
'''spec''':
  uid: 9b95bf05-c6b8-11e7-9f09-525400360e56
  <span id='spec_selector'></span>'''selector''':
spec:
    '''matchLabels''':
  selector:
      <font color=teal>component</font>: <font color=teal>fluentd</font>
    matchLabels:
      <font color=teal>provider</font>: <font color=teal>openshift</font>
      component: fluentd
  '''template''':
      provider: openshift
    '''metadata''':
  template:
      <span id='template_metadata_labels'></span>'''labels''':
    metadata:
        <font color=teal>component</font>: <font color=teal>fluentd</font>
      creationTimestamp: null
        <font color=teal>provider</font>: <font color=teal>openshift</font>
      labels:
        logging-infra: fluentd
        component: fluentd
      name: fluentd-elasticsearch
        logging-infra: fluentd
    '''spec''':
        provider: openshift
      <span id='node-selector'></span>'''nodeSelector''':
      name: fluentd-elasticsearch
        logging-infra-fluentd: "true"
    spec:
      containers:
      containers:
      - env:
      - env:
        - name: K8S_HOST_URL
        - name: K8S_HOST_URL
          value: https&#58;//kubernetes.default.svc.cluster.local
          value: https://kubernetes.default.svc.cluster.local
        - name: ES_HOST
        - name: ES_HOST
          value: logging-es
          value: logging-es
        - name: ES_PORT
        - name: ES_PORT
          value: "9200"
          value: "9200"
        - name: ES_CLIENT_CERT
        - name: ES_CLIENT_CERT
          value: /etc/fluent/keys/cert
          value: /etc/fluent/keys/cert
        - name: ES_CLIENT_KEY
        - name: ES_CLIENT_KEY
          value: /etc/fluent/keys/key
          value: /etc/fluent/keys/key
        - name: ES_CA
        - name: ES_CA
          value: /etc/fluent/keys/ca
          value: /etc/fluent/keys/ca
        - name: OPS_HOST
        - name: OPS_HOST
          value: logging-es
          value: logging-es
        - name: OPS_PORT
        - name: OPS_PORT
          value: "9200"
          value: "9200"
        - name: OPS_CLIENT_CERT
        - name: OPS_CLIENT_CERT
          value: /etc/fluent/keys/cert
          value: /etc/fluent/keys/cert
        - name: OPS_CLIENT_KEY
        - name: OPS_CLIENT_KEY
          value: /etc/fluent/keys/key
          value: /etc/fluent/keys/key
        - name: OPS_CA
        - name: OPS_CA
          value: /etc/fluent/keys/ca
          value: /etc/fluent/keys/ca
        - name: ES_COPY
        - name: ES_COPY
          value: "false"
          value: "false"
        - name: JOURNAL_SOURCE
        - name: JOURNAL_SOURCE
        - name: JOURNAL_READ_FROM_HEAD
        - name: JOURNAL_READ_FROM_HEAD
        - name: BUFFER_QUEUE_LIMIT
        - name: BUFFER_QUEUE_LIMIT
          value: "1024"
          value: "1024"
        - name: BUFFER_SIZE_LIMIT
        - name: BUFFER_SIZE_LIMIT
          value: 1m
          value: 1m
        - name: FLUENTD_CPU_LIMIT
        - name: FLUENTD_CPU_LIMIT
          valueFrom:
          valueFrom:
            resourceFieldRef:
            resourceFieldRef:
              containerName: fluentd-elasticsearch
              containerName: fluentd-elasticsearch
              divisor: "0"
              divisor: "0"
              resource: limits.cpu
              resource: limits.cpu
        - name: FLUENTD_MEMORY_LIMIT
        - name: FLUENTD_MEMORY_LIMIT
            valueFrom:
          valueFrom:
            resourceFieldRef:
            resourceFieldRef:
              containerName: fluentd-elasticsearch
              containerName: fluentd-elasticsearch
              divisor: "0"
              divisor: "0"
              resource: limits.memory
              resource: limits.memory
        - name: FILE_BUFFER_LIMIT
        - name: FILE_BUFFER_LIMIT
          value: 1Gi
          value: 1Gi
        image: registry.access.redhat.com/openshift3/logging-fluentd:v3.6
        image: registry.access.redhat.com/openshift3/logging-fluentd:v3.6
        imagePullPolicy: Always
        imagePullPolicy: Always
        name: fluentd-elasticsearch
        name: fluentd-elasticsearch
        resources:
        resources:
          limits:
          limits:
            cpu: 100m
            cpu: 100m
            memory: 512Mi
            memory: 512Mi
          requests:
          requests:
            memory: 512Mi
            memory: 512Mi
        securityContext:
        securityContext:
          privileged: true
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        terminationMessagePolicy: File
        volumeMounts:
        volumeMounts:
        - mountPath: /run/log/journal
        - mountPath: /run/log/journal
          name: runlogjournal
          name: runlogjournal
        - mountPath: /var/log
        - mountPath: /var/log
          name: varlog
          name: varlog
        - mountPath: /var/lib/docker/containers
        - mountPath: /var/lib/docker/containers
          name: varlibdockercontainers
          name: varlibdockercontainers
          readOnly: true
          readOnly: true
        - mountPath: /etc/fluent/configs.d/user
        - mountPath: /etc/fluent/configs.d/user
          name: config
          name: config
          readOnly: true
          readOnly: true
        - mountPath: /etc/fluent/keys
        - mountPath: /etc/fluent/keys
          name: certs
          name: certs
          readOnly: true
          readOnly: true
        - mountPath: /etc/docker-hostname
        - mountPath: /etc/docker-hostname
          name: dockerhostname
          name: dockerhostname
          readOnly: true
          readOnly: true
        - mountPath: /etc/localtime
        - mountPath: /etc/localtime
          name: localtime
          name: localtime
          readOnly: true
          readOnly: true
        - mountPath: /etc/sysconfig/docker
        - mountPath: /etc/sysconfig/docker
          name: dockercfg
          name: dockercfg
          readOnly: true
          readOnly: true
        - mountPath: /etc/docker
        - mountPath: /etc/docker
          name: dockerdaemoncfg
          name: dockerdaemoncfg
          readOnly: true
          readOnly: true
        - mountPath: /var/lib/fluentd
        - mountPath: /var/lib/fluentd
          name: filebufferstorage
          name: filebufferstorage
      dnsPolicy: ClusterFirst
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      nodeSelector:
      schedulerName: default-scheduler
        logging-infra-fluentd: "true"
      securityContext: {}
      restartPolicy: Always
      serviceAccount: aggregated-logging-fluentd
      schedulerName: default-scheduler
      serviceAccountName: aggregated-logging-fluentd
      securityContext: {}
      terminationGracePeriodSeconds: 30
      serviceAccount: aggregated-logging-fluentd
      volumes:
      serviceAccountName: aggregated-logging-fluentd
      - hostPath:
      terminationGracePeriodSeconds: 30
          path: /run/log/journal
      volumes:
        name: runlogjournal
      - hostPath:
      - hostPath:
          path: /run/log/journal
          path: /var/log
        name: runlogjournal
        name: varlog
      - hostPath:
      - hostPath:
          path: /var/log
          path: /var/lib/docker/containers
        name: varlog
        name: varlibdockercontainers
      - hostPath:
      - configMap:
          path: /var/lib/docker/containers
          defaultMode: 420
        name: varlibdockercontainers
      - configMap:
          defaultMode: 420
           name: logging-fluentd
           name: logging-fluentd
        name: config
        name: config
      - name: certs
      - name: certs
        secret:
        secret:
          defaultMode: 420
          defaultMode: 420
           secretName: logging-fluentd
           secretName: logging-fluentd
      - hostPath:
      - hostPath:
          path: /etc/hostname
          path: /etc/hostname
        name: dockerhostname
        name: dockerhostname
      - hostPath:
      - hostPath:
          path: /etc/localtime
          path: /etc/localtime
        name: localtime
        name: localtime
      - hostPath:
      - hostPath:
          path: /etc/sysconfig/docker
          path: /etc/sysconfig/docker
        name: dockercfg
        name: dockercfg
      - hostPath:
      - hostPath:
          path: /etc/docker
          path: /etc/docker
        name: dockerdaemoncfg
        name: dockerdaemoncfg
      - hostPath:
      - hostPath:
          path: /var/lib/fluentd
          path: /var/lib/fluentd
        name: filebufferstorage
        name: filebufferstorage
  templateGeneration: 1
  templateGeneration: 1
  updateStrategy:
  updateStrategy:
    rollingUpdate:
    rollingUpdate:
      maxUnavailable: 1
      maxUnavailable: 1
    type: RollingUpdate
    type: RollingUpdate
status:
status:
  currentNumberScheduled: 3
  currentNumberScheduled: 3
  desiredNumberScheduled: 3
  desiredNumberScheduled: 3
  numberAvailable: 3
  numberAvailable: 3
  numberMisscheduled: 0
  numberMisscheduled: 0
  numberReady: 3
  numberReady: 3
  observedGeneration: 1
  observedGeneration: 1
  updatedNumberScheduled: 3
  updatedNumberScheduled: 3
</syntaxhighlight>

Latest revision as of 18:30, 9 February 2018

Internal

Overview

The .spec.template is a pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.

The pod template in a DaemonSet must have a RestartPolicy equal to Always, or be unspecified, which defaults to Always.

Definition

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  creationTimestamp: 2017-11-11T08:16:24Z
  generation: 1
  labels:
    component: fluentd
    logging-infra: fluentd
    provider: openshift
  name: logging-fluentd
  namespace: logging
  resourceVersion: "2865410"
  selfLink: /apis/extensions/v1beta1/namespaces/logging/daemonsets/logging-fluentd
  uid: 9b95bf05-c6b8-11e7-9f09-525400360e56
spec:
  selector:
    matchLabels:
      component: fluentd
      provider: openshift
  template:
    metadata:
      labels:
        component: fluentd
        provider: openshift
        logging-infra: fluentd
      name: fluentd-elasticsearch
    spec:
      nodeSelector:
        logging-infra-fluentd: "true"
      containers:
      - env:
        - name: K8S_HOST_URL
          value: https://kubernetes.default.svc.cluster.local
        - name: ES_HOST
          value: logging-es
        - name: ES_PORT
          value: "9200"
        - name: ES_CLIENT_CERT
          value: /etc/fluent/keys/cert
        - name: ES_CLIENT_KEY
          value: /etc/fluent/keys/key
        - name: ES_CA
          value: /etc/fluent/keys/ca
        - name: OPS_HOST
          value: logging-es
        - name: OPS_PORT
          value: "9200"
        - name: OPS_CLIENT_CERT
          value: /etc/fluent/keys/cert
        - name: OPS_CLIENT_KEY
          value: /etc/fluent/keys/key
        - name: OPS_CA
          value: /etc/fluent/keys/ca
        - name: ES_COPY
          value: "false"
        - name: JOURNAL_SOURCE
        - name: JOURNAL_READ_FROM_HEAD
        - name: BUFFER_QUEUE_LIMIT
          value: "1024"
        - name: BUFFER_SIZE_LIMIT
          value: 1m
        - name: FLUENTD_CPU_LIMIT
          valueFrom:
            resourceFieldRef:
              containerName: fluentd-elasticsearch
              divisor: "0"
              resource: limits.cpu
        - name: FLUENTD_MEMORY_LIMIT
           valueFrom:
            resourceFieldRef:
              containerName: fluentd-elasticsearch
              divisor: "0"
              resource: limits.memory
        - name: FILE_BUFFER_LIMIT
          value: 1Gi
        image: registry.access.redhat.com/openshift3/logging-fluentd:v3.6
        imagePullPolicy: Always
        name: fluentd-elasticsearch
        resources:
          limits:
            cpu: 100m
            memory: 512Mi
          requests:
            memory: 512Mi
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /run/log/journal
          name: runlogjournal
        - mountPath: /var/log
          name: varlog
        - mountPath: /var/lib/docker/containers
          name: varlibdockercontainers
          readOnly: true
        - mountPath: /etc/fluent/configs.d/user
          name: config
          readOnly: true
        - mountPath: /etc/fluent/keys
          name: certs
          readOnly: true
        - mountPath: /etc/docker-hostname
          name: dockerhostname
          readOnly: true
        - mountPath: /etc/localtime
          name: localtime
          readOnly: true
        - mountPath: /etc/sysconfig/docker
          name: dockercfg
          readOnly: true
        - mountPath: /etc/docker
          name: dockerdaemoncfg
          readOnly: true
        - mountPath: /var/lib/fluentd
          name: filebufferstorage
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: aggregated-logging-fluentd
      serviceAccountName: aggregated-logging-fluentd
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /run/log/journal
        name: runlogjournal
      - hostPath:
          path: /var/log
        name: varlog
      - hostPath:
          path: /var/lib/docker/containers
        name: varlibdockercontainers
      - configMap:
          defaultMode: 420
         name: logging-fluentd
        name: config
      - name: certs
        secret:
          defaultMode: 420
         secretName: logging-fluentd
      - hostPath:
          path: /etc/hostname
        name: dockerhostname
      - hostPath:
          path: /etc/localtime
        name: localtime
      - hostPath:
          path: /etc/sysconfig/docker
        name: dockercfg
      - hostPath:
          path: /etc/docker
        name: dockerdaemoncfg
      - hostPath:
          path: /var/lib/fluentd
        name: filebufferstorage
  templateGeneration: 1
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
status:
  currentNumberScheduled: 3
  desiredNumberScheduled: 3
  numberAvailable: 3
  numberMisscheduled: 0
  numberReady: 3
  observedGeneration: 1
  updatedNumberScheduled: 3