Skip to content

feat: option for app-controller Deployment instead of StatefulSet #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
version: 2.11.9-ak.0.0
version: 2.11.9-ak.0.1
appVersion: 2.11.9
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
Expand Down
7 changes: 4 additions & 3 deletions charts/argo-cd/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argo-cd

![Version: 2.11.9-ak.0.0](https://img.shields.io/badge/Version-2.11.7--ak.0.0-informational?style=flat-square) ![AppVersion: 2.11.9](https://img.shields.io/badge/AppVersion-2.11.9-informational?style=flat-square)
![Version: 2.11.9-ak.0.1](https://img.shields.io/badge/Version-2.11.9--ak.0.1-informational?style=flat-square) ![AppVersion: 2.11.9](https://img.shields.io/badge/AppVersion-2.11.9-informational?style=flat-square)

A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.

Expand Down Expand Up @@ -37,6 +37,7 @@ A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kube
| controller.args | object | `{"operationProcessors":"10","statusProcessors":"20"}` | Argo controller commandline flags |
| controller.args.operationProcessors | string | `"10"` | Number of application operation processors |
| controller.args.statusProcessors | string | `"20"` | Number of application status processors |
| controller.deployment | bool | `false` | Deploys the application controller as a Deployment |
| controller.extraArgs | string | `nil` | Additional command line arguments to pass to argocd-controller |
| controller.image.pullPolicy | string | `nil` | |
| controller.image.repository | string | `nil` | |
Expand All @@ -60,7 +61,7 @@ A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kube
| imageUpdater.enabled | bool | `false` | Whether to enable image updater |
| notificationsController | object | `{"enabled":true}` | Notifications Controller |
| notificationsController.enabled | bool | `true` | Whether to enable Notifications Controller |
| redis | object | `{"enabled":true,"haProxyImage":{"repository":"haproxy","tag":"2.6.14-alpine"},"networkPolicy":{"egress":{"enabled":true}},"image":{"pullPolicy":null,"repository":"quay.io/akuity/redis","tag":"7.0.15-alpine"},"resources":null}` | Redis configurations |
| redis | object | `{"config":["min-replicas-to-write 0","client-output-buffer-limit replica 512mb 128mb 60","repl-backlog-size 512mb"],"enabled":true,"haProxyImage":{"repository":"haproxy","tag":"2.6.14-alpine"},"image":{"pullPolicy":null,"repository":"quay.io/akuity/redis","tag":"7.0.15-alpine"},"networkPolicy":{"egress":{"enabled":true}},"resources":null}` | Redis configurations |
| repoServer | object | `{"extraArgs":null,"image":{"pullPolicy":null,"repository":null,"tag":null},"replicas":2,"resources":null}` | Repo Server |
| repoServer.extraArgs | string | `nil` | Additional command line arguments to pass to argocd-repo-server |
| server | object | `{"enabled":true,"extraArgs":null,"image":{"pullPolicy":null,"repository":null,"tag":null},"ingress":{"annotations":{},"className":"","enabled":false,"host":"argocd.example.com","tls":{"enabled":false,"secretName":null}},"insecure":false,"replicas":2,"resources":null,"service":{"type":null}}` | Argo Server configuration |
Expand All @@ -71,4 +72,4 @@ A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kube
| server.service | object | `{"type":null}` | Server service configuration |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
287 changes: 287 additions & 0 deletions charts/argo-cd/templates/application-controller/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
{{- if .Values.controller.deployment }}
apiVersion: apps/v1
kind: Deployment
Comment on lines +1 to +3
Copy link
Member

@jessesuen jessesuen Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a whole new file, would it not be easier to change the kind based on the {{- if .Values.controller.deployment }} ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it would be much easier. However I wanted to have a clear separation between the Deployment & StatefulSet, specifically if the number of replicas was increased beyond 1 and dynamicClusterDistribution was not enabled.

I'm happy to make the suggested changes if that makes more sense.

metadata:
labels:
app.kubernetes.io/name: argocd-application-controller
app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: application-controller
name: argocd-application-controller
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: argocd-application-controller
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: argocd-application-controller
spec:
containers:
- args:
- /usr/local/bin/argocd-application-controller
{{- with .Values.controller.extraArgs }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.controller.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
{{- with .Values.controller.env }}
{{- toYaml . | nindent 10 }}
{{- end }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
key: auth
name: argocd-redis
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
configMapKeyRef:
name: argocd-cm
key: timeout.reconciliation
optional: true
- name: ARGOCD_HARD_RECONCILIATION_TIMEOUT
valueFrom:
configMapKeyRef:
name: argocd-cm
key: timeout.hard.reconciliation
optional: true
- name: ARGOCD_RECONCILIATION_JITTER
valueFrom:
configMapKeyRef:
key: timeout.reconciliation.jitter
name: argocd-cm
optional: true
- name: ARGOCD_REPO_ERROR_GRACE_PERIOD_SECONDS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.repo.error.grace.period.seconds
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: repo.server
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.repo.server.timeout.seconds
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_STATUS_PROCESSORS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.status.processors
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_OPERATION_PROCESSORS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.operation.processors
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_LOGFORMAT
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.log.format
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_LOGLEVEL
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.log.level
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.metrics.cache.expiration
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_TIMEOUT_SECONDS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.self.heal.timeout.seconds
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_PLAINTEXT
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.repo.server.plaintext
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_STRICT_TLS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.repo.server.strict.tls
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.resource.health.persist
optional: true
- name: ARGOCD_APP_STATE_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.app.state.cache.expiration
optional: true
- name: REDIS_SERVER
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.server
optional: true
- name: REDIS_COMPRESSION
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.compression
optional: true
- name: REDISDB
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.db
optional: true
- name: ARGOCD_DEFAULT_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.default.cache.expiration
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_OTLP_ADDRESS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: otlp.address
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_OTLP_INSECURE
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: otlp.insecure
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_OTLP_HEADERS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: otlp.headers
optional: true
- name: ARGOCD_APPLICATION_NAMESPACES
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: application.namespaces
optional: true
- name: ARGOCD_CONTROLLER_SHARDING_ALGORITHM
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.sharding.algorithm
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.kubectl.parallelism.limit
optional: true
- name: ARGOCD_K8SCLIENT_RETRY_MAX
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.k8sclient.retry.max
optional: true
- name: ARGOCD_K8SCLIENT_RETRY_BASE_BACKOFF
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.k8sclient.retry.base.backoff
optional: true
- name: ARGOCD_APPLICATION_CONTROLLER_SERVER_SIDE_DIFF
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: controller.diff.server.side
optional: true
image: {{ include "argo-cd.image" (dict "root" . "image" .Values.controller.image ) }}
imagePullPolicy: {{ default .Values.global.image.pullPolicy .Values.controller.image.pullPolicy }}
name: argocd-application-controller
ports:
- containerPort: 8082
readinessProbe:
httpGet:
path: /healthz
port: 8082
initialDelaySeconds: 5
periodSeconds: 10
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
workingDir: /home/argocd
volumeMounts:
{{- with .Values.controller.volumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: argocd-repo-server-tls
mountPath: /app/config/controller/tls
- name: argocd-home
mountPath: /home/argocd
- name: argocd-cmd-params-cm
mountPath: /home/argocd/params
serviceAccountName: argocd-application-controller
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: argocd-application-controller
topologyKey: kubernetes.io/hostname
- weight: 5
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/part-of: argocd
topologyKey: kubernetes.io/hostname
volumes:
{{- with .Values.controller.volumes }}
{{- toYaml . | nindent 6}}
{{- end }}
- emptyDir: {}
name: argocd-home
- name: argocd-repo-server-tls
secret:
secretName: argocd-repo-server-tls
optional: true
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
- key: ca.crt
path: ca.crt
- name: argocd-cmd-params-cm
configMap:
optional: true
name: argocd-cmd-params-cm
items:
- key: controller.profile.enabled
path: profiler.enabled
nodeSelector:
kubernetes.io/os: linux
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.controller.deployment | default false }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -281,3 +282,4 @@ spec:
path: ca.crt
optional: true
secretName: argocd-repo-server-tls
{{- end }}
4 changes: 4 additions & 0 deletions charts/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ server:

## Controller
controller:

# Deploys the application controller as a Deployment. This is useful if you are only deploying to a single cluster or
# want to enable the dynamic cluster distribution feature.
deployment: false
image:
repository: # defaults to global.image.repository
tag: # defaults to global.image.tag
Expand Down
Loading