StatefulSet挂载ConfigMap

  sre

cm

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: example-configmap
data:
  a: "1"
  b: "2"

StatefulSet

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: example
spec:
  selector:
    matchLabels:
      app: example
  serviceName: example
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
        - name: example
          image: nginx:stable-alpine
          volumeMounts:
            - mountPath: /config
              name: example-config
      volumes:
        - name: example-config
          configMap:
            name: example-configmap

LEAVE A COMMENT

Captcha Code