apiVersion: v1 kind: Namespace metadata: name: gofer-system --- apiVersion: v1 kind: ServiceAccount metadata: name: gofer namespace: gofer-system --- # The operator's volume holds only sealed state and wrapped data keys. # It opens with the key-encryption key in the Secret gofer-kek, which is # backed up apart from it. apiVersion: v1 kind: PersistentVolumeClaim metadata: name: gofer-state namespace: gofer-system spec: accessModes: [ReadWriteOnce] resources: requests: storage: 1Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: gofer namespace: gofer-system spec: replicas: 1 # One copy writes the volume at a time. strategy: type: Recreate selector: matchLabels: app.kubernetes.io/name: gofer template: metadata: labels: app.kubernetes.io/name: gofer spec: serviceAccountName: gofer securityContext: runAsNonRoot: true runAsUser: 65532 runAsGroup: 65532 fsGroup: 65532 seccompProfile: type: RuntimeDefault containers: - name: operator image: atcr.io/guid.foo/gofer env: - name: GOFER_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: GOFER_SIDECAR_IMAGE value: atcr.io/guid.foo/gofer-sidecar:dev ports: - name: https containerPort: 8443 # /metrics and /healthz, in plain HTTP. - name: metrics containerPort: 9200 readinessProbe: httpGet: path: /healthz port: https scheme: HTTPS # The metrics port's /healthz fails until every watch holds its # first read, and while the API server forbids the watch of # profiles. livenessProbe: httpGet: path: /healthz port: metrics periodSeconds: 20 failureThreshold: 3 resources: requests: cpu: 10m memory: 32Mi limits: memory: 256Mi securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: [ALL] volumeMounts: - name: state mountPath: /data volumes: - name: state persistentVolumeClaim: claimName: gofer-state --- apiVersion: v1 kind: Service metadata: name: gofer namespace: gofer-system spec: selector: app.kubernetes.io/name: gofer ports: - name: https port: 8443 targetPort: https - name: metrics port: 9200 targetPort: metrics