kubernetes部署gitea代码控制工具

  sre

pvc gitea-data

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


Deployment gitea

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

svc gitea

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

从sqlite安装即可

LEAVE A COMMENT

Captcha Code