workflow-test/charts/azure-agent/templates/deployment.yaml

93 lines
3.0 KiB
YAML
Raw Permalink Normal View History

2024-10-15 08:11:11 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "az-agent.fullname" . }}
labels:
{{- include "az-agent.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "az-agent.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "az-agent.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "az-agent.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: AZP_URL
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}
key: AZP_URL
- name: AZP_POOL
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}
key: AZP_POOL
- name: HARBOR_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}-harbor
key: HARBOR_USERNAME
- name: HARBOR_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}-harbor
key: HARBOR_PASSWORD
- name: HARBOR_HOST
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}-harbor
key: HARBOR_HOST
- name: HARBOR_PORT
valueFrom:
secretKeyRef:
name: {{ include "az-agent.fullname" . }}-harbor
key: HARBOR_PORT
volumeMounts:
- name: azp-token
mountPath: /home/agent/.token
subPath: .token
readOnly: true
volumes:
- name: azp-token
secret:
secretName: {{ include "az-agent.fullname" . }}
items:
- key: AZP_TOKEN
path: .token
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}