#@ load("@ytt:data", "data")
#@ load("lib/consts.star", "version", "deployment")

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: #@ data.values.app_name
    app.kubernetes.io/version: #@ version
  name: #@ deployment["name"]
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: controller
      app.kubernetes.io/name: #@ data.values.app_name
  template:
    metadata:
      labels:
        app.kubernetes.io/component: controller
        app.kubernetes.io/name: #@ data.values.app_name
        app.kubernetes.io/version: #@ version
    spec:
      containers:
        - name: prometheus-operator
          image: #@ "quay.io/coreos/prometheus-operator:" + version
          args:
            - --kubelet-service=kube-system/kubelet
            - --logtostderr=true
            - --config-reloader-image=jimmidyson/configmap-reload:v0.3.0
            - #@ "--prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader:" + version
          ports:
          - name: http
            containerPort: #@ deployment["containerPort"]
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 200m
              memory: 200Mi
      securityContext:
        runAsNonRoot: yes
        runAsUser: 65534

      