v2-12.jpg

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: gogs
  labels:
    app: gogs
spec:
  serviceName: gogs
  replicas: 1
  selector:
    matchLabels:
      app: gogs
  template:
    metadata:
      labels:
        app: gogs
    spec:
      terminationGracePeriodSeconds: 180
      containers:
      - name: gogs
        image: gogs/gogs
        imagePullPolicy: Always
        ports:
        - containerPort: 3000
          name: port
        - containerPort: 22
          name: ssh-port
        volumeMounts:
        - name: volume
          mountPath: /data
      volumes:
      - name: volume
        emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: gogs
  labels:
    app: gogs
spec:
  type: NodePort
  ports:
  - port: 3000
    targetPort: 3000
  selector:
    app: gogs

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code