其他分享
首页 > 其他分享> > k8s yaml文件详解

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

 

标签:name,var,nagios2,nagios,yaml,详解,Directory,k8s,type
来源: https://www.cnblogs.com/networking/p/11834182.html