# Source: opentelemetry-operator/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    helm.sh/chart: opentelemetry-operator-0.49.1
    app.kubernetes.io/name: opentelemetry-operator
    app.kubernetes.io/version: "0.95.0"
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: open-telemetry
    app.kubernetes.io/component: controller-manager
  name: open-telemetry-opentelemetry-operator
  namespace: vynil-monitor
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: opentelemetry-operator
      app.kubernetes.io/component: controller-manager
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/default-container: manager
      labels:
        app.kubernetes.io/name: opentelemetry-operator
        app.kubernetes.io/component: controller-manager
    spec:
      hostNetwork: false
      containers:
        - args:
            - --metrics-addr=0.0.0.0:8080
            - --enable-leader-election
            - --health-probe-addr=:8081
            - --webhook-port=9443
            - --collector-image=otel/opentelemetry-collector-contrib:0.95.0
          command:
            - /manager
          env:
            - name: ENABLE_WEBHOOKS
              value: "true"
          image: "ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.95.0"
          name: manager
          ports:
            - containerPort: 8080
              name: metrics
              protocol: TCP
            - containerPort: 9443
              name: webhook-server
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8081
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /readyz
              port: 8081
            initialDelaySeconds: 5
            periodSeconds: 10
          resources: 
            limits:
              cpu: 100m
              memory: 128Mi
            requests:
              cpu: 100m
              memory: 64Mi
          volumeMounts:
            - mountPath: /tmp/k8s-webhook-server/serving-certs
              name: cert
              readOnly: true
          securityContext: 
            allowPrivilegeEscalation: false
            capabilities:
              drop:
              - ALL
        
        - args:
            - --secure-listen-address=0.0.0.0:8443
            - --upstream=http://127.0.0.1:8080/
            - --logtostderr=true
            - --v=0
          image: "quay.io/brancz/kube-rbac-proxy:v0.15.0"
          name: kube-rbac-proxy
          ports:
            - containerPort: 8443
              name: https
              protocol: TCP
          resources: 
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 5m
              memory: 64Mi
          securityContext: 
            allowPrivilegeEscalation: false
            capabilities:
              drop:
              - ALL
      serviceAccountName: opentelemetry-operator
      terminationGracePeriodSeconds: 10
      volumes:
        - name: cert
          secret:
            defaultMode: 420
            secretName: open-telemetry-opentelemetry-operator-controller-manager-service-cert
      securityContext:
        fsGroup: 65532
        runAsGroup: 65532
        runAsNonRoot: true
        runAsUser: 65532