pvc gogs-data

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gogs-data
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "640Gi"
  volumeName: 
  storageClassName: nfs

Deployment gogs

apiVersion: apps/v1
kind: Deployment
metadata:
  name: gogs
  labels:
    app: gogs
spec:
  selector:
    matchLabels:
      app: gogs
  template:
    metadata:
      labels:
        app: gogs
    spec:
      containers:
      - name: gogs
        #image: gogs/gogs
        image: registry.cn-hangzhou.aliyuncs.com/sre_pub/gogs
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3000
          name: gogs
        - containerPort: 22
          name: ssh
        volumeMounts:
        - name: gogs-data
          mountPath: /data
      volumes:
      - name: gogs-data
        persistentVolumeClaim:
          claimName: gogs-data

svc gogs

apiVersion: v1
kind: Service
metadata:
  name: gogs
spec:
  type: NodePort
  ports:
  - name: gogs
    protocol: TCP
    port: 3000
    targetPort: 3000
    nodePort: 30026
  selector:
    app: gogs

使用SQLite进行安装即可

发表评论

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

Captcha Code