Skip to content

Commit

Permalink
enable helm for kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
diogosilva30 committed Nov 12, 2024
1 parent ac28023 commit de1e5b9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 66 deletions.
11 changes: 1 addition & 10 deletions bootstrap/argo-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: argocd-autopilot
app.kubernetes.io/name: argo-cd
Expand Down Expand Up @@ -37,12 +36,4 @@ spec:
# lastAppliedConfig annotation
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#server-side-apply
- ServerSideApply=true
status:
health: {}
summary: {}
sync:
comparedTo:
destination: {}
source:
repoURL: ""
status: ""

96 changes: 40 additions & 56 deletions bootstrap/argo-cd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,12 @@ namespace: argocd
apiVersion: kustomize.config.k8s.io/v1beta1

# configMapGenerator:
# - behavior: merge
# name: argocd-cm
# - behavior: create
# name: argocd-cmd-params-cm
# namespace: argocd
# literals:
# - kustomize.buildOptions=--enable-alpha-plugins --enable-helm --load-restrictor LoadRestrictionsNone
# # Enable web terminal to exec into pods
# # https://argo-cd.readthedocs.io/en/stable/operator-manual/web_based_terminal/
# - exec.enabled="true"
# - timeout.reconciliation=15s
# # Need to specify URL of argo, otherwise we get error on OIDC:
# # https://github.com/argoproj/argo-helm/issues/1593
# - url="https://argo.lab.local"
# # Configure OIDC authentication
# # https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#existing-oidc-provider
# - |
# oidc.config=
# name: Keycloak Shared Services
# issuer: https://idp.dsilva.dev/realms/master
# clientID: argocd
# clientSecret: $oidc.keycloak.clientSecret
# requestedScopes: ["openid", "profile", "email", "groups"]
# redirectURL: https://argo.lab.local/
# # Disable HTTPS redirection
# - server.insecure="true"

resources:
# Prometheus operator CRDs
Expand All @@ -38,41 +22,41 @@ resources:
# as annotations (check `kustomize.commonAnnotations` in `project/common.yaml`).
# So we just need to make a kustomize replacement of the value we want to replace
# with the annotation value
replacements:
- source:
kind: Ingress
name: argocd-ingress
fieldPath: metadata.annotations.dns
targets:
- select:
kind: Ingress
name: argocd-ingress
fieldPaths:
- spec.rules.0.host
options:
# This keeps the "argo." prefix
delimiter: "."
index: 1
# replacements:
# - source:
# kind: Ingress
# name: argocd-ingress
# fieldPath: metadata.annotations.dns
# targets:
# - select:
# kind: Ingress
# name: argocd-ingress
# fieldPaths:
# - spec.rules.0.host
# options:
# # This keeps the "argo." prefix
# delimiter: "."
# index: 1

# Add the patch to the deployment
patches:
# https://argo-cd.readthedocs.io/en/stable/operator-manual/custom_tools/
- target:
kind: Deployment
name: argocd-repo-server
path: manifests/repo-server-deployment-patch.yaml
- target:
kind: Role
name: argocd-server
path: manifests/web-terminal-permission-patch.yaml
# # Add the patch to the deployment
# patches:
# # https://argo-cd.readthedocs.io/en/stable/operator-manual/custom_tools/
# - target:
# kind: Deployment
# name: argocd-repo-server
# path: manifests/repo-server-deployment-patch.yaml
# - target:
# kind: Role
# name: argocd-server
# path: manifests/web-terminal-permission-patch.yaml

# reset the crbs to `subject.namespace: default`, so that argo-cd will later change them to the actual ns
# From https://github.com/argoproj-labs/argocd-autopilot/blob/main/manifests/ha/kustomization.yaml
- target:
group: rbac.authorization.k8s.io
version: v1
kind: ClusterRoleBinding
patch: |-
- op: replace
path: /subjects/0/namespace
value: default
# # reset the crbs to `subject.namespace: default`, so that argo-cd will later change them to the actual ns
# # From https://github.com/argoproj-labs/argocd-autopilot/blob/main/manifests/ha/kustomization.yaml
# - target:
# group: rbac.authorization.k8s.io
# version: v1
# kind: ClusterRoleBinding
# patch: |-
# - op: replace
# path: /subjects/0/namespace
# value: default

0 comments on commit de1e5b9

Please sign in to comment.