| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: gogs
- namespace: nginx-app
- labels:
- app: gogs
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: gogs
- template:
- metadata:
- labels:
- app: gogs
- spec:
- containers:
- - name: gogs
- image: registry.cn-hangzhou.aliyuncs.com/zhongpengqun/wanderer:linux-amd64-gogs-0.13
- ports:
- - containerPort: 3000
- - containerPort: 22
- env:
- # 关键1:HTTP_HOST=0.0.0.0 监听全网卡
- - name: GOGS__server__HTTP_HOST
- value: "0.0.0.0"
- # 关键2:ROOT_URL换成你的域名,后续gogs内部跳转正常
- - name: GOGS__server__ROOT_URL
- value: "http://gogs2.9981.tech"
- - name: GOGS__database__DB_TYPE
- value: "sqlite3"
- - name: GOGS__database__PATH
- value: "/data/gogs.db"
- volumeMounts:
- - name: gogs-data
- mountPath: /data
- resources:
- requests:
- memory: "256Mi"
- cpu: "250m"
- limits:
- memory: "512Mi"
- cpu: "1000m"
- volumes:
- - name: gogs-data
- persistentVolumeClaim:
- claimName: gogs-pvc
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: gogs-service
- namespace: nginx-app
- labels:
- app: gogs
- spec:
- selector:
- app: gogs
- ports:
- - name: http
- port: 3000
- targetPort: 3000
- - name: ssh
- port: 22
- targetPort: 22
- type: ClusterIP
- ---
- apiVersion: v1
- kind: PersistentVolumeClaim
- metadata:
- name: gogs-pvc
- namespace: nginx-app
- spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: 5Gi
|