1234.PNG

pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gitea-data
  namespace: cicd
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: "1000Gi"
  volumeName: 
  storageClassName: nas

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: gitea
  namespace: cicd
  labels:
    app: gitea
spec:
  selector:
    matchLabels:
      app: gitea
  template:
    metadata:
      labels:
        app: gitea
    spec:
      containers:
      - name: gitea
        image: gitea/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

apiVersion: v1
kind: Service
metadata:
  name: gitea
  namespace: cicd
spec:
  ports:
  - name: gitea
    protocol: TCP
    port: 3000
    targetPort: 3000
  - name: ssh
    protocol: TCP
    port: 22
    targetPort: 22
  selector:
    app: gitea


发表评论

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

Captcha Code