diff --git a/charts/app-of-apps-acm-team-onboarding/Chart.yaml b/charts/app-of-apps-acm-team-onboarding/Chart.yaml index ec19330..c8f1c83 100644 --- a/charts/app-of-apps-acm-team-onboarding/Chart.yaml +++ b/charts/app-of-apps-acm-team-onboarding/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: app-of-apps-acm-team-onboarding description: Chart to onboard teams on an ACM hub with AppProjects, RBAC, and placement infrastructure for spoke deployment via ApplicationSets -version: 0.3.1 +version: 0.4.0 home: https://rh-mobb.github.io/validated-pattern-helm-charts/ maintainers: - name: rh-mobb diff --git a/charts/app-of-apps-acm-team-onboarding/templates/managedclusterset-binding.yaml b/charts/app-of-apps-acm-team-onboarding/templates/managedclusterset-binding.yaml deleted file mode 100644 index b7c4fd8..0000000 --- a/charts/app-of-apps-acm-team-onboarding/templates/managedclusterset-binding.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: cluster.open-cluster-management.io/v1beta2 -kind: ManagedClusterSetBinding -metadata: - name: global - namespace: {{ .Values.gitopsNamespace }} - finalizers: - - resources-finalizer.argocd.argoproj.io - annotations: - argocd.argoproj.io/sync-wave: "10" - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true -spec: - clusterSet: global diff --git a/charts/app-of-apps-acm-team-onboarding/templates/placement.yaml b/charts/app-of-apps-acm-team-onboarding/templates/placement.yaml deleted file mode 100644 index 437d372..0000000 --- a/charts/app-of-apps-acm-team-onboarding/templates/placement.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: cluster.open-cluster-management.io/v1beta1 -kind: Placement -metadata: - name: all-spoke-clusters - namespace: {{ .Values.gitopsNamespace }} - finalizers: - - resources-finalizer.argocd.argoproj.io - annotations: - argocd.argoproj.io/sync-wave: "10" - argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true -spec: - clusterSets: - - global - predicates: - - requiredClusterSelector: - labelSelector: - matchExpressions: - - key: acm - operator: In - values: - - spoke - decisionStrategy: - groupStrategy: - clustersPerDecisionGroup: 100 - decisionGroups: - - groupName: spoke-clusters - groupClusterSelector: - labelSelector: - matchLabels: {} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: acm-placement - namespace: {{ .Values.gitopsNamespace }} - annotations: - argocd.argoproj.io/sync-wave: "10" -data: - apiVersion: cluster.open-cluster-management.io/v1beta1 - kind: placementdecisions - statusListKey: decisions - matchKey: clusterName diff --git a/charts/cluster-bootstrap-acm-hub-registration/Chart.yaml b/charts/cluster-bootstrap-acm-hub-registration/Chart.yaml index a61dcbb..dc3ee9c 100644 --- a/charts/cluster-bootstrap-acm-hub-registration/Chart.yaml +++ b/charts/cluster-bootstrap-acm-hub-registration/Chart.yaml @@ -5,5 +5,5 @@ apiVersion: v2 name: cluster-bootstrap-acm-hub-registration description: Helm chart to register spoke clusters with ACM hub type: application -version: 0.1.4 +version: 0.2.1 appVersion: "1.0" diff --git a/charts/cluster-bootstrap-acm-hub-registration/templates/gitopscluster.yaml b/charts/cluster-bootstrap-acm-hub-registration/templates/gitopscluster.yaml index 1ed742d..bc89b25 100644 --- a/charts/cluster-bootstrap-acm-hub-registration/templates/gitopscluster.yaml +++ b/charts/cluster-bootstrap-acm-hub-registration/templates/gitopscluster.yaml @@ -26,6 +26,6 @@ spec: placementRef: kind: Placement apiVersion: cluster.open-cluster-management.io/v1beta1 - name: {{ .Values.gitopsCluster.placementName }} + name: {{ .Values.clusterName }} {{- end }} {{- end }} diff --git a/charts/cluster-bootstrap-acm-hub-registration/templates/managedcluster.yaml b/charts/cluster-bootstrap-acm-hub-registration/templates/managedcluster.yaml index 282c864..e3b6005 100644 --- a/charts/cluster-bootstrap-acm-hub-registration/templates/managedcluster.yaml +++ b/charts/cluster-bootstrap-acm-hub-registration/templates/managedcluster.yaml @@ -6,6 +6,7 @@ metadata: acm: spoke environment: {{ .Values.environment }} name: {{ .Values.clusterName }} + cluster.open-cluster-management.io/clusterset: {{ .Values.clusterName }} spec: hubAcceptsClient: {{ .Values.managedCluster.hubAcceptsClient }} leaseDurationSeconds: {{ .Values.managedCluster.leaseDurationSeconds }} diff --git a/charts/cluster-bootstrap-acm-hub-registration/templates/managedclusterset.yaml b/charts/cluster-bootstrap-acm-hub-registration/templates/managedclusterset.yaml new file mode 100644 index 0000000..36494db --- /dev/null +++ b/charts/cluster-bootstrap-acm-hub-registration/templates/managedclusterset.yaml @@ -0,0 +1,49 @@ +{{- if .Values.gitopsCluster.appArgoNamespace }} +--- +# Per-cluster ManagedClusterSet so that each spoke can be individually +# bound to namespaces and referenced by team Placements. +apiVersion: cluster.open-cluster-management.io/v1beta2 +kind: ManagedClusterSet +metadata: + name: {{ .Values.clusterName }} +spec: {} +--- +# Bind this cluster's set to the application-gitops namespace so that +# Placements there can select it. +apiVersion: cluster.open-cluster-management.io/v1beta2 +kind: ManagedClusterSetBinding +metadata: + name: {{ .Values.clusterName }} + namespace: {{ .Values.gitopsCluster.appArgoNamespace }} +spec: + clusterSet: {{ .Values.clusterName }} +--- +# Per-cluster Placement that resolves to exactly this spoke. +# ApplicationSets reference this by name via clusterDecisionResource. +apiVersion: cluster.open-cluster-management.io/v1beta1 +kind: Placement +metadata: + name: {{ .Values.clusterName }} + namespace: {{ .Values.gitopsCluster.appArgoNamespace }} +spec: + clusterSets: + - {{ .Values.clusterName }} + predicates: + - requiredClusterSelector: + labelSelector: + matchLabels: + name: {{ .Values.clusterName }} +--- +# ConfigMap for the clusterDecisionResource generator to discover +# PlacementDecisions created by the above Placement. +apiVersion: v1 +kind: ConfigMap +metadata: + name: acm-placement-{{ .Values.clusterName }} + namespace: {{ .Values.gitopsCluster.appArgoNamespace }} +data: + apiVersion: cluster.open-cluster-management.io/v1beta1 + kind: placementdecisions + statusListKey: decisions + matchKey: clusterName +{{- end }}