Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Mar 30, 2023
2 parents d787a00 + e0fc5f5 commit cf96d7a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ helm upgrade --install agent clemlesne-azure-pipelines-agent/azure-pipelines-age
| `initContainers` | InitContainers for the agent pod. | `[]` |
| `nameOverride` | Overrides release name | `""` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `pipelines.cacheSize` | Total cache the pipeline can take during execution, by default [the same amount as the Microsoft Hosted agents](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#hardware). | `10Gi` |
| `pipelines.cacheType` | Disk type to attach to the agents, see your cloud provider for mor details ([Azure](https://learn.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes), [AWS](https://docs.aws.amazon.com/eks/latest/userguide/storage-classes.html)). | `managed-csi` (Azure compatible) |
| `pipelines.pat` | Personal Access Token (PAT) used by the agent to connect. | *None* |
| `pipelines.pool` | Agent pool to which the Agent should register. | *None* |
| `pipelines.url` | The Azure base URL for your organization | *None* |
Expand Down
1 change: 1 addition & 0 deletions src/helm/azure-pipelines-agent/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ metadata:
{{- include "this.labels" . | nindent 4 }}
spec:
scaleTargetRef:
kind: StatefulSet
name: {{ include "this.fullname" . }}
maxReplicaCount: {{ .Values.autoscaling.maxReplicas }}
minReplicaCount: {{ .Values.autoscaling.minReplicas }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ include "this.fullname" . }}
labels:
{{- include "this.labels" . | nindent 4 }}
spec:
podManagementPolicy: Parallel
{{- if not (and (.Values.autoscaling.enabled) (.Capabilities.APIVersions.Has "keda.sh/v1alpha1")) }}
replicas: {{ .Values.autoscaling.minReplicas }}
{{- end }}
selector:
matchLabels:
{{- include "this.selectorLabels" . | nindent 6 }}
serviceName: {{ include "this.fullname" . }}
template:
metadata:
labels:
Expand All @@ -23,6 +25,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "this.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.autoscaling.cooldown }}
containers:
- name: {{ .Chart.Name }}
Expand All @@ -44,7 +52,7 @@ spec:
- name: AZP_POOL
value: {{ .Values.pipelines.pool | quote | required "A value for .Values.pipelines.pool is required" }}
- name: AZP_WORK
value: {{ .Values.pipelines.workDir | quote }}
value: {{ .Values.pipelines.workDir | quote }}
- name: AZP_TOKEN
valueFrom:
secretKeyRef:
Expand All @@ -55,10 +63,12 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.extraVolumeMounts }}
volumeMounts:
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
- name: workdir
mountPath: {{ .Values.pipelines.workDir | quote }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.extraVolumes }}
volumes:
{{- toYaml .Values.extraVolumes | nindent 8 }}
Expand All @@ -75,3 +85,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.pipelines.cacheType }}
resources:
requests:
storage: {{ .Values.pipelines.cacheSize }}
4 changes: 3 additions & 1 deletion src/helm/azure-pipelines-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ autoscaling:
cooldown: 60

pipelines:
url: null
cacheSize: 10Gi
cacheType: managed-csi
pat: null
pool: null
url: null
workDir: _work

serviceAccount:
Expand Down

0 comments on commit cf96d7a

Please sign in to comment.