k8s yaml文件详解

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nagios2
  labels:
    app: nagios2
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nagios2
  template:
    metadata:
      labels:
        app: nagios2
    spec:
      containers:
      - name: nagios2
        image: docker.io/jasonrivers/nagios
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /opt/nagios/etc/
          name: etc
        - mountPath: /opt/nagios/var/
          name: var
        - mountPath: /opt/Custom-Nagios-Plugins
          name: plugins
        - mountPath: /opt/nagiosgraph/var
          name: nagiosgraph
        - mountPath: /opt/nagiosgraph/etc
          name: nagiosetc
      volumes:
        - name: etc
          hostPath:
            path: /data/nagios/etc
            type: Directory
        - name: var
          hostPath:
            path: /data/nagios/var
            type: Directory
        - name: plugins
          hostPath:
            path: /data/nagios/Plugins
            type: Directory
        - name: nagiosgraph
          hostPath:
            path: /data/nagios/nagiosgraph
            type: Directory
        - name: nagiosetc
          hostPath:
            path: /data/nagios/nagiosetc
            type: Directory

 

上一篇:单向循环链表实现


下一篇:P2670 [NOIP2015 普及组] 扫雷游戏