#@ app_name = "prometheus-operator"
#@ version = "v0.39.0"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: #@ app_name
    app.kubernetes.io/version: #@ version
  name: #@ app_name
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: controller
      app.kubernetes.io/name: #@ app_name
  template:
    metadata:
      labels:
        app.kubernetes.io/component: controller
        app.kubernetes.io/name: #@ 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: 8080}]
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 100Mi
      securityContext:
        runAsNonRoot: yes
        runAsUser: 65534
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: #@ app_name
    app.kubernetes.io/version: #@ version
  name: #@ app_name + "-service"
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 38080
      protocol: TCP
      targetPort: 8080
  selector:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: #@ app_name
