apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pharos-platform-git namespace: argocd spec: accessModes: - ReadWriteOnce storageClassName: ceph-block resources: # Every delivery pushes a bundle and keeps the delivered branch plus its recent revisions; 2 GiB filled after # forty deliveries and the next push failed with "Out of diskspace" before anything reached the cluster. requests: storage: 10Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: pharos-platform-git namespace: argocd spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: pharos-platform-git template: metadata: labels: app: pharos-platform-git spec: automountServiceAccountToken: false securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 seccompProfile: type: RuntimeDefault containers: - name: git image: docker.io/alpine/git:2.52.0@sha256:4a0e72d49596a1f5d3701aeedafdadc5c0da4062be4657c7bdc4017387f591cc command: - sh - -c # BuildKit fetches the delivered commit by its SHA, which upload-pack refuses by default. - test -d /git/platform.git || git init --bare /git/platform.git; git -C /git/platform.git config uploadpack.allowReachableSHA1InWant true; exec /tools/git-daemon --reuseaddr --base-path=/git --export-all --strict-paths --listen=0.0.0.0 --port=9418 /git/platform.git securityContext: &id001 allowPrivilegeEscalation: false capabilities: drop: - ALL ports: - containerPort: 9418 readinessProbe: tcpSocket: port: 9418 resources: requests: cpu: 25m memory: 64Mi limits: memory: 256Mi volumeMounts: - name: git mountPath: /git - name: tools mountPath: /tools readOnly: true env: - name: HOME value: /git volumes: - name: git persistentVolumeClaim: claimName: pharos-platform-git - name: package configMap: name: pharos-platform-git-daemon - name: tools emptyDir: {} initContainers: - name: verified-git-daemon image: docker.io/alpine/git:2.52.0@sha256:4a0e72d49596a1f5d3701aeedafdadc5c0da4062be4657c7bdc4017387f591cc command: - sh - -ec - sha256sum -c /package/sha256; tar -xzf /package/git-daemon.apk -C /tools --strip-components=3 usr/libexec/git-core/git-daemon securityContext: *id001 volumeMounts: - name: package mountPath: /package readOnly: true - name: tools mountPath: /tools --- apiVersion: v1 kind: Service metadata: name: pharos-platform-git namespace: argocd spec: selector: app: pharos-platform-git ports: - port: 9418 targetPort: 9418 --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: pharos-platform-git namespace: argocd spec: podSelector: matchLabels: app: pharos-platform-git policyTypes: - Ingress - Egress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: argocd-repo-server # The image builds read the same delivered commit (bootstrap/build.yaml). - namespaceSelector: matchLabels: kubernetes.io/metadata.name: pharos-build podSelector: matchLabels: app.kubernetes.io/component: image-build ports: - protocol: TCP port: 9418 egress: []