Skip to content

Commit

Permalink
feat: replacing Kustomize JSON patches with strategic merge patches.
Browse files Browse the repository at this point in the history
These patches prevent resource fields replacement
  • Loading branch information
jfavellar90 committed Nov 1, 2023
1 parent 1f80b22 commit 65a4b70
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
31 changes: 4 additions & 27 deletions drydock/patches/kustomization
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,21 @@ patches:
- target:
kind: Job
labelSelector: app.kubernetes.io/component=job
patch: |-
- op: add
path: /metadata/annotations
value:
argocd.argoproj.io/hook: Skip
argocd.argoproj.io/hook-delete-policy: HookFailed
- op: add
path: /spec
value:
ttlSecondsAfterFinished: 100
path: plugins/drydock/k8s/patches/tutor-jobs.yml
# Patch the sync waves
- target:
kind: Deployment
name: "lms-worker|cms-worker|forum"
patch: |-
- op: add
path: /metadata/annotations
value:
argocd.argoproj.io/sync-wave: "4"
path: plugins/drydock/k8s/patches/sync-wave-4.yml
{%- if DRYDOCK_DEBUG is defined and DRYDOCK_DEBUG %}
- target:
kind: Deployment|Ingress|Service
name: "cms-debug|lms-debug|ingress-debug"
patch: |-
- op: add
path: /metadata/annotations
value:
argocd.argoproj.io/sync-wave: "5"
path: plugins/drydock/k8s/patches/sync-wave-5.yml
{%- endif %}
{%- if POD_AUTOSCALING_LMS_HPA is defined and POD_AUTOSCALING_LMS_HPA %}
- target:
kind: HorizontalPodAutoscaler
patch: |-
- op: add
path: /metadata/annotations
value:
argocd.argoproj.io/sync-wave: "5"
{%- endif %}
path: plugins/drydock/k8s/patches/sync-wave-5.yml
{% if DRYDOCK_ENABLE_CELERY_TUNING %}
- path: plugins/drydock/k8s/celery/cms-worker.yml
- path: plugins/drydock/k8s/celery/lms-worker.yml
Expand Down
6 changes: 6 additions & 0 deletions drydock/templates/drydock/k8s/patches/sync-wave-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: not-used
kind: not-used
metadata:
name: not-used
annotations:
argocd.argoproj.io/sync-wave: "4"
6 changes: 6 additions & 0 deletions drydock/templates/drydock/k8s/patches/sync-wave-5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: not-used
kind: not-used
metadata:
name: not-used
annotations:
argocd.argoproj.io/sync-wave: "5"
9 changes: 9 additions & 0 deletions drydock/templates/drydock/k8s/patches/tutor-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: batch/v1
kind: Job
metadata:
name: not-used
annotations:
argocd.argoproj.io/hook: Skip
argocd.argoproj.io/hook-delete-policy: HookFailed
spec:
ttlSecondsAfterFinished: 100

0 comments on commit 65a4b70

Please sign in to comment.