apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: kubernetes-operator
    app.kubernetes.io/instance: configmap-operator
    app.kubernetes.io/name: configmap-operator
  name: configmap-operator
  namespace: configmap-operator-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: kubernetes-operator
      app.kubernetes.io/instance: configmap-operator
      app.kubernetes.io/name: configmap-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/component: kubernetes-operator
        app.kubernetes.io/instance: configmap-operator
        app.kubernetes.io/name: configmap-operator
    spec:
      containers:
      - args:
        - run
        - --log.level=info
        - --log.format=json
        - --refresh.interval=15s
        - --namespace=$(NAMESPACE)
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: saswatamcode/configmap-operator
        imagePullPolicy: IfNotPresent
        name: configmap-operator
        ports:
        - containerPort: 9090
        resources: {}
      serviceAccount: configmap-operator-sa
