apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "storageos.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "storageos.name" . }}
    chart: {{ template "storageos.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ template "storageos.name" . }}
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ template "storageos.name" . }}
        release: {{ .Release.Name }}
    spec:
      serviceAccountName: {{ template "storageos.serviceAccountName" . }}
      containers:
        - name: storageos-operator
          image: "{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}"
          imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - cluster-operator
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: "cluster-operator"
