
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: storageos
    app.kubernetes.io/component: portal-manager
    control-plane: storageos-portal-manager
  name: storageos-portal-manager
  namespace: portal-manager-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: storageos
      app.kubernetes.io/component: portal-manager
      control-plane: storageos-portal-manager
  template:
    metadata:
      labels:
        app: storageos
        app.kubernetes.io/component: portal-manager
        control-plane: storageos-portal-manager
    spec:
      containers:
      - args:
        - --config=portal_config.yaml
        command:
        - /manager
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: TENANT_ID
          valueFrom:
            secretKeyRef:
              key: TENANT_ID
              name: storageos-portal-client
        - name: CLIENT_ID
          valueFrom:
            secretKeyRef:
              key: CLIENT_ID
              name: storageos-portal-client
        - name: PASSWORD
          valueFrom:
            secretKeyRef:
              key: PASSWORD
              name: storageos-portal-client
        - name: URL
          valueFrom:
            secretKeyRef:
              key: URL
              name: storageos-portal-client
        image: controller:latest
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
        name: manager
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 5
          periodSeconds: 10
        securityContext:
          allowPrivilegeEscalation: false
        volumeMounts:
        - mountPath: /portal_config.yaml
          name: storageos-portal-manager
          subPath: portal_config.yaml
        - mountPath: /etc/storageos/secrets/api
          name: api-secret
          readOnly: true
      - args:
        - --secure-listen-address=0.0.0.0:8443
        - --upstream=http://127.0.0.1:8080/
        - --logtostderr=true
        - --v=10
        image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
        name: kube-rbac-proxy
        ports:
        - containerPort: 8443
          name: https
      securityContext:
        runAsNonRoot: true
      serviceAccountName: storageos-portal-manager
      terminationGracePeriodSeconds: 10
      volumes:
      - configMap:
          name: storageos-portal-manager
        name: storageos-portal-manager
      - name: api-secret
        secret:
          secretName: storageos-api
