---
apiVersion: v1
kind: Service
metadata:
  name: helm-mongo
  namespace: zhbf
  labels:
    cmii.app: helm-mongo
    cmii.type: middleware
    helm.sh/chart: mongo-1.1.0
    app.kubernetes.io/managed-by: octopus-control
    app.kubernetes.io/version: 6.2.0
spec:
  type: NodePort
  selector:
    cmii.app: helm-mongo
    cmii.type: middleware
  ports:
    - port: 27017
      name: server-27017
      targetPort: 27017
      nodePort: 37017
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: helm-mongo
  namespace: zhbf
  labels:
    cmii.app: helm-mongo
    cmii.type: middleware
    helm.sh/chart: mongo-1.1.0
    app.kubernetes.io/managed-by: octopus-control
    app.kubernetes.io/version: 6.2.0
spec:
  serviceName: helm-mongo
  replicas: 1
  selector:
    matchLabels:
      cmii.app: helm-mongo
      cmii.type: middleware
  template:
    metadata:
      labels:
        cmii.app: helm-mongo
        cmii.type: middleware
        helm.sh/chart: mongo-1.1.0
        app.kubernetes.io/managed-by: octopus-control
        app.kubernetes.io/version: 6.2.0
      annotations:
        pod.alpha.kubernetes.io/initialized: "true"
    spec:
      imagePullSecrets:
        - name: harborsecret
      affinity: {}
      containers:
        - name: helm-mongo
          image: 192.168.233.100:8033/cmii/mongo:5.0
          resources: {}
          ports:
            - containerPort: 27017
              name: mongo27017
              protocol: TCP
          env:
            - name: MONGO_INITDB_ROOT_USERNAME
              value: cmlc
            - name: MONGO_INITDB_ROOT_PASSWORD
              value: REdPza8#oVlt
          volumeMounts:
            - name: mongo-data
              mountPath: /data/db
              readOnly: false
              subPath: default/helm-mongo/data/db
      volumes:
        - name: mongo-data
          persistentVolumeClaim:
            claimName: helm-mongo
---
