Skip to content

Commit 9c92766

Browse files
authored
Merge pull request #1060 from rackerlabs/avoid-namespace-creation
feat(argocd): sync only out of sync objects and don't manipulate the openstack namespace everywhere
2 parents 7f00332 + 8f6702d commit 9c92766

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed

apps/appsets/appset-understack-global.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,20 @@ spec:
7575
automated:
7676
selfHeal: true
7777
syncOptions:
78+
# Create the namespace we are using if it doesn't already exist.
7879
- CreateNamespace=true
80+
# Use the server side apply behavior of kubernetes for resources, we've got the
81+
# compare option set above to support this.
7982
- ServerSideApply=true
83+
# Resources might have mutated fields and we want to allow those to be set without
84+
# ArgoCD coming back and smacking them back. The ignoreDifferences templatePatch
85+
# uses this feature.
8086
- RespectIgnoreDifferences=true
87+
# Enable selective sync so that resources that have a difference are applied
88+
# instead of always applying all resources. This prevents us from always
89+
# running jobs.
90+
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync
91+
- ApplyOutOfSyncOnly=true
8192
managedNamespaceMetadata:
8293
annotations:
8394
# ArgoCD can create our namespace but let's not delete it

apps/appsets/appset-understack-infra.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,20 @@ spec:
7676
automated:
7777
selfHeal: true
7878
syncOptions:
79+
# Create the namespace we are using if it doesn't already exist.
7980
- CreateNamespace=true
81+
# Use the server side apply behavior of kubernetes for resources, we've got the
82+
# compare option set above to support this.
8083
- ServerSideApply=true
84+
# Resources might have mutated fields and we want to allow those to be set without
85+
# ArgoCD coming back and smacking them back. The ignoreDifferences templatePatch
86+
# uses this feature.
8187
- RespectIgnoreDifferences=true
88+
# Enable selective sync so that resources that have a difference are applied
89+
# instead of always applying all resources. This prevents us from always
90+
# running jobs.
91+
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync
92+
- ApplyOutOfSyncOnly=true
8293
managedNamespaceMetadata:
8394
annotations:
8495
# ArgoCD can create our namespace but let's not delete it

apps/appsets/appset-understack-openstack.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,18 @@ spec:
104104
automated:
105105
selfHeal: true
106106
syncOptions:
107-
- CreateNamespace=true
107+
# Use the server side apply behavior of kubernetes for resources, we've got the
108+
# compare option set above to support this.
108109
- ServerSideApply=true
110+
# Resources might have mutated fields and we want to allow those to be set without
111+
# ArgoCD coming back and smacking them back. The ignoreDifferences templatePatch
112+
# uses this feature.
109113
- RespectIgnoreDifferences=true
110-
managedNamespaceMetadata:
111-
annotations:
112-
# ArgoCD can create our namespace but let's not delete it
113-
argocd.argoproj.io/sync-options: Delete=false
114-
labels:
115-
kubernetes.io/metadata.name: openstack
116-
name: openstack
114+
# Enable selective sync so that resources that have a difference are applied
115+
# instead of always applying all resources. This prevents us from always
116+
# running DB migrations and messing with keystone users and endpoints.
117+
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync
118+
- ApplyOutOfSyncOnly=true
117119
templatePatch: |
118120
spec:
119121
ignoreDifferences: {{ dig "ignoreDifferences" list . | toJson }}

apps/appsets/appset-understack-operators.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,20 @@ spec:
7676
automated:
7777
selfHeal: true
7878
syncOptions:
79+
# Create the namespace we are using if it doesn't already exist.
7980
- CreateNamespace=true
81+
# Use the server side apply behavior of kubernetes for resources, we've got the
82+
# compare option set above to support this.
8083
- ServerSideApply=true
84+
# Resources might have mutated fields and we want to allow those to be set without
85+
# ArgoCD coming back and smacking them back. The ignoreDifferences templatePatch
86+
# uses this feature.
8187
- RespectIgnoreDifferences=true
88+
# Enable selective sync so that resources that have a difference are applied
89+
# instead of always applying all resources. This prevents us from always
90+
# running jobs.
91+
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync
92+
- ApplyOutOfSyncOnly=true
8293
managedNamespaceMetadata:
8394
annotations:
8495
# ArgoCD can create our namespace but let's not delete it

apps/appsets/appset-understack-site.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,20 @@ spec:
7575
automated:
7676
selfHeal: true
7777
syncOptions:
78+
# Create the namespace we are using if it doesn't already exist.
7879
- CreateNamespace=true
80+
# Use the server side apply behavior of kubernetes for resources, we've got the
81+
# compare option set above to support this.
7982
- ServerSideApply=true
83+
# Resources might have mutated fields and we want to allow those to be set without
84+
# ArgoCD coming back and smacking them back. The ignoreDifferences templatePatch
85+
# uses this feature.
8086
- RespectIgnoreDifferences=true
87+
# Enable selective sync so that resources that have a difference are applied
88+
# instead of always applying all resources. This prevents us from always
89+
# running jobs.
90+
# https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync
91+
- ApplyOutOfSyncOnly=true
8192
managedNamespaceMetadata:
8293
annotations:
8394
# ArgoCD can create our namespace but let's not delete it

0 commit comments

Comments
 (0)