apiVersion: apps/v1
kind: Deployment
metadata:
  name: dummy
  namespace: dummy
  labels:
    app.kubernetes.io/name: dummy
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dummy
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
      labels:
        app.kubernetes.io/name: dummy
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/os
                    operator: NotIn
                    values:
                      - windows
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/name: dummy
                topologyKey: kubernetes.io/hostname
              weight: 100
      serviceAccountName: dummy
      containers:
        - name: dummy
          image: dummy
          # Resource request required for autoscaler to take any action for a metric
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 500m
              memory: 500Mi
          volumeMounts:
            - name: dummy
              mountPath: /etc/dummy

          env:
            - name: SYSTEM_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: dummy
              value: dummy
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - all
            runAsUser: 65532
            runAsGroup: 65532
          ports:
            - name: abc
              containerPort: 8080
            - name: def
              containerPort: 9090

          livenessProbe:
            httpGet:
              path: /health
              port: probes
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /readiness
              port: probes
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
            timeoutSeconds: 5
      volumes:
        - name: dummy
          configMap:
            name: dummy
