|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: autoscaler-hpa |
| 5 | + namespace: knative-serving |
| 6 | + labels: |
| 7 | + autoscaling.knative.dev/autoscaler-provider: hpa |
| 8 | + app.kubernetes.io/component: autoscaler-hpa |
| 9 | + app.kubernetes.io/name: knative-serving |
| 10 | + app.kubernetes.io/version: "1.3.2" |
| 11 | + serving.knative.dev/release: "v1.3.2" |
| 12 | + {{- include "knative-serving.labels" . | nindent 4 }} |
| 13 | +spec: |
| 14 | + selector: |
| 15 | + matchLabels: |
| 16 | + app: autoscaler-hpa |
| 17 | + {{- include "knative-serving.selectorLabels" . | nindent 6 }} |
| 18 | + template: |
| 19 | + metadata: |
| 20 | + annotations: |
| 21 | + cluster-autoscaler.kubernetes.io/safe-to-evict: "true" |
| 22 | + labels: |
| 23 | + app: autoscaler-hpa |
| 24 | + app.kubernetes.io/component: autoscaler-hpa |
| 25 | + app.kubernetes.io/name: knative-serving |
| 26 | + app.kubernetes.io/version: "1.3.2" |
| 27 | + serving.knative.dev/release: "v1.3.2" |
| 28 | + {{- include "knative-serving.labels" . | nindent 8 }} |
| 29 | + spec: |
| 30 | + # To avoid node becoming SPOF, spread our replicas to different nodes. |
| 31 | + affinity: |
| 32 | + podAntiAffinity: |
| 33 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 34 | + - podAffinityTerm: |
| 35 | + labelSelector: |
| 36 | + matchLabels: |
| 37 | + app: autoscaler-hpa |
| 38 | + topologyKey: kubernetes.io/hostname |
| 39 | + weight: 100 |
| 40 | + serviceAccountName: controller |
| 41 | + containers: |
| 42 | + - name: autoscaler-hpa |
| 43 | + # This is the Go import path for the binary that is containerized |
| 44 | + # and substituted here. |
| 45 | + {{- with .Values.hpa.image }} |
| 46 | + image: {{ .repository }}:{{ .tag }} |
| 47 | + {{- end }} |
| 48 | + resources: {{- toYaml .Values.hpa.resources | nindent 10 }} |
| 49 | + env: |
| 50 | + - name: SYSTEM_NAMESPACE |
| 51 | + valueFrom: |
| 52 | + fieldRef: |
| 53 | + fieldPath: metadata.namespace |
| 54 | + - name: CONFIG_LOGGING_NAME |
| 55 | + value: config-logging |
| 56 | + - name: CONFIG_OBSERVABILITY_NAME |
| 57 | + value: config-observability |
| 58 | + - name: METRICS_DOMAIN |
| 59 | + value: knative.dev/serving |
| 60 | + securityContext: |
| 61 | + allowPrivilegeEscalation: false |
| 62 | + readOnlyRootFilesystem: true |
| 63 | + runAsNonRoot: true |
| 64 | + capabilities: |
| 65 | + drop: |
| 66 | + - all |
| 67 | + ports: |
| 68 | + - name: metrics |
| 69 | + containerPort: 9090 |
| 70 | + - name: profiling |
| 71 | + containerPort: 8008 |
| 72 | + |
| 73 | + |
0 commit comments