kubernetes部署portainer管理控制台

  sre

pvc portainer

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: portainer
  namespace: ecs
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "1024Gi"
  volumeName: 
  storageClassName: nfs

svc portainer

apiVersion: v1
kind: Service
metadata:
 name: portainer
 namespace: ecs
spec:
 type: NodePort
 ports:
 - port: 9000
   targetPort: 9000
   nodePort: 30009
 selector:
   app: portainer

Deployment portainer

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: portainer
  name: portainer
  namespace: ecs
spec:
  selector:
    matchLabels:
      app: portainer
  template:
    metadata:
      labels:
        app: portainer
    spec:
      containers:
      - image: portainer/portainer
        imagePullPolicy: IfNotPresent
        name: portainer
        ports:
        - containerPort: 9000
        volumeMounts:
        - name: docker-sock
          mountPath: /var/run/docker.sock
        - name: portainer-data
          mountPath: /data
      volumes:
      - name: docker-sock
        hostPath:
          path: /var/run/docker.sock
      - name: portainer-data
        persistentVolumeClaim:
          claimName: portainer

LEAVE A COMMENT

Captcha Code