Skip to content
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

Managed clusters #176

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## October 3, 2022
* Support both .Values.managedClusterGroups and the old .Values.clusterGroup.managedClusterGroups
* Restore the ability to install a non-default site: `make TARGET_SITE=mysite install`
* Revised tests (new output and filenames, requires adding new result files to git)
* ACM 2.6 required for ACM-based managed sites
Expand Down
1 change: 1 addition & 0 deletions acm
8 changes: 0 additions & 8 deletions acm/templates/multiclusterhub.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion clustergroup/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ clusterGroup:
name: acm
namespace: open-cluster-management
project: hub
path: common/acm
path: common/managedclusters
ignoreDifferences:
- group: internal.open-cluster-management.io
kind: ManagedClusterInfo
Expand Down
2 changes: 1 addition & 1 deletion examples/values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ clusterGroup:
name: acm
namespace: open-cluster-management
project: datacenter
path: common/acm
path: common/managedclusters
ignoreDifferences:
- group: internal.open-cluster-management.io
kind: ManagedClusterInfo
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions managedclusters/templates/acm/multiclusterhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- $haveACM := false }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- if not .hostedArgoSites }}
{{- $haveACM = true }}
{{- end }}
{{- end }}
{{- if $haveACM }}
apiVersion: operator.open-cluster-management.io/v1
kind: MultiClusterHub
metadata:
name: multiclusterhub
namespace: open-cluster-management
annotations:
argocd.argoproj.io/sync-wave: "-1"
spec: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# TODO: Also create a GitOpsCluster.apps.open-cluster-management.io
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- if not .hostedArgoSites }}
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: {{ .name }}-clustergroup-policy
namespace: open-cluster-management
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
Expand Down Expand Up @@ -98,6 +99,7 @@ apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: {{ .name }}-placement-binding
namespace: open-cluster-management
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
Expand All @@ -113,6 +115,7 @@ apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: {{ .name }}-placement
namespace: open-cluster-management
spec:
clusterConditions:
- status: 'True'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{{- $haveACM := false }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- if not .hostedArgoSites }}
{{- $haveACM = true }}
{{- end }}
{{- end }}
{{- if $haveACM }}
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: openshift-gitops-policy
namespace: open-cluster-management
annotations:
policy.open-cluster-management.io/standards: NIST-CSF
policy.open-cluster-management.io/categories: PR.DS Data Security
Expand Down Expand Up @@ -49,6 +57,7 @@ apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: openshift-gitops-placement-binding
namespace: open-cluster-management
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
Expand All @@ -64,6 +73,7 @@ apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: openshift-gitops-placement
namespace: open-cluster-management
spec:
clusterConditions:
- status: 'True'
Expand All @@ -74,3 +84,4 @@ spec:
operator: In
values:
- OpenShift
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- if .clusterPools }}{{- /* We only create ManagedClusterSets if there are clusterPools defined */}}
apiVersion: cluster.open-cluster-management.io/v1beta1
Expand Down Expand Up @@ -84,4 +84,4 @@ spec:
{{- end }}{{- /* range .range clusters */}}
{{- end }}{{- /* range .clusterPools */}}
{{- end }}{{- /* if .clusterPools) */}}
{{- end }}{{- /* range .Values.clusterGroup.managedClusterGroups */}}
{{- end }}{{- /* range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups */}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- range .clusterPools }}
{{- $poolName := print .name "-" $group.name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- range .clusterPools }}
{{- $poolName := print .name "-" $group.name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- range .clusterPools }}
{{- $poolName := print .name "-" $group.name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if (eq .Values.enabled "all") }}
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- range coalesce .Values.managedClusterGroups .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- if .hostedArgoSites }}
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -174,4 +173,3 @@ spec:
---
{{- end }}
{{- end }}
{{- end }}
File renamed without changes.
File renamed without changes.
Loading