apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: swir-operator
spec:
  selector:
    matchLabels:
      app: swir-operator
  replicas: 1 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: swir-operator
    spec:
      serviceAccountName: swir-operator
      containers:
      - name: swir-operator
        image: swir/swir-operator:v0.3.2
        env:
          - name: SWIR_SIDECAR_IMAGE_VERSION
            value: swir/swir:v0.3.2
        volumeMounts:
          - name: config-volume
            mountPath: /configs/library
          - name: certs-volume
            mountPath: /certs/library
      volumes: 
        - name: config-volume
          configMap:
            name: swir-operator-config-library
            items:
            - key: books.yaml
              path: books-config.yaml
            - key: helpdesk.yaml
              path: helpdesk-config.yaml
            - key: magazines.yaml
              path: magazines-config.yaml
        - name: certs-volume
          configMap:
            name: swir-operator-certs-library
            items:
            - key: client.internal_grpc.swir.rs.cert.pem
              path: client.internal_grpc.swir.rs.cert.pem
            - key: client.internal_grpc.swir.rs.key.pem
              path: client.internal_grpc.swir.rs.key.pem
            - key: ca-chain.cert.pem
              path: ca-chain.cert.pem
            - key: server.internal_grpc.swir.rs.cert.pem
              path: server.internal_grpc.swir.rs.cert.pem
            - key: server.internal_grpc.swir.rs.key.pem
              path: server.internal_grpc.swir.rs.key.pem
              


        
