apiVersion: apps/v1 kind: Deployment metadata: name: aptly spec: replicas: 1 strategy: type: Recreate selector: matchLabels: component: server template: metadata: labels: component: server spec: securityContext: seccompProfile: type: RuntimeDefault initContainers: - name: init-htpasswd image: httpd:alpine command: - sh - -c - htpasswd -bc /opt/aptly/api.htpasswd "$API_USER" "$API_PASSWORD" env: - name: API_USER value: "{{ .apiUser }}" - name: API_PASSWORD valueFrom: secretKeyRef: name: aptly-secrets key: apiPassword securityContext: allowPrivilegeEscalation: false volumeMounts: - name: data mountPath: /opt/aptly containers: - name: aptly image: urpylka/aptly:1.6.2 ports: - containerPort: 80 name: http - containerPort: 8080 name: api securityContext: allowPrivilegeEscalation: false volumeMounts: - name: data mountPath: /opt/aptly volumes: - name: data persistentVolumeClaim: claimName: aptly-pvc