system-config/kubernetes/gitea/k8s/deployment.yaml
Monty Taylor 3513dfb9fc Prevent gitea pods from being co-scheduled
For scale out purposes, we only want one gitea pod per underlying
kubernetes node. Use podAntiAffinity to accomplish this.

Change-Id: Icd8f70cf7e1640e58133f67e8a519267ac3b36d3
2019-02-06 09:29:39 -08:00

84 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
namespace: gitea
labels:
app: gitea
spec:
revisionHistoryLimit: 1
replicas: 4
selector:
matchLabels:
app: gitea
template:
metadata:
labels:
app: gitea
spec:
initContainers:
- name: gitea-config
image: opendevorg/gitea-init
env:
- {name: VERBOSE, value: '1'}
volumeMounts:
- {name: config-template, mountPath: /config_src}
- {name: gitea-conf, mountPath: /conf}
- {name: gitea-data, mountPath: /data}
- {name: secrets, mountPath: /secrets}
containers:
- name: gitea
image: opendevorg/gitea
env:
- name: deployment_id
value: '1' # Increment to trigger a deployment.
ports:
- containerPort: 3000
volumeMounts:
- name: gitea-data
mountPath: /data
- name: gitea-conf
mountPath: /custom/conf
- name: logs
mountPath: /logs
- name: openssh
image: opendevorg/gitea-openssh
ports:
- containerPort: 22
volumeMounts:
- name: gitea-data
mountPath: /data
- name: gitea-conf
mountPath: /custom/conf
- name: logs
mountPath: /logs
volumes:
- name: gitea-data
flexVolume:
driver: ceph.rook.io/rook
fsType: ceph
options:
fsName: rookfs
clusterNamespace: rook-ceph
clusterName: rook-ceph
- name: config-template
configMap:
name: gitea-conf
- name: gitea-conf
emptyDir:
- name: logs
emptyDir:
- name: secrets
secret:
secretName: gitea-app
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- gitea
topologyKey: "kubernetes.io/hostname"