Skip to content
Closed
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
161 changes: 161 additions & 0 deletions acm/templates/provision/clusterdeployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}

{{- if $group.clusterDeployments }}

---
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSet
metadata:
name: {{ $group.name }}
annotations:
cluster.open-cluster-management.io/submariner-broker-ns: {{ $group.name }}-broker

---
{{- range $group.clusterDeployments}}
{{ $cluster := . }}

apiVersion: v1
kind: Namespace
metadata:
name: {{ $cluster.name }}

---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ $cluster.name }}-cluster-private-key
namespace: {{ $cluster.name }}
spec:
dataFrom:
- extract:
conversionStrategy: Default
decodingStrategy: None
key: secret/hub/privatekey
metadataPolicy: None
refreshInterval: 24h0m0s
secretStoreRef:
kind: ClusterSecretStore
name: vault-backend
target:
creationPolicy: Owner
deletionPolicy: Retain
name: {{ $cluster.name }}-cluster-private-key
template:
engineVersion: v2
mergePolicy: Replace
type: Opaque

---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ $cluster.name }}-cluster-pull-secret
namespace: {{ $cluster.name }}
spec:
dataFrom:
- extract:
conversionStrategy: Default
decodingStrategy: None
key: secret/hub/openshiftPullSecret
metadataPolicy: None
refreshInterval: 24h0m0s
secretStoreRef:
kind: ClusterSecretStore
name: vault-backend
target:
creationPolicy: Owner
deletionPolicy: Retain
name: {{ $cluster.name }}-cluster-pull-secret
template:
engineVersion: v2
mergePolicy: Replace
type: Opaque

---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ $cluster.name }}-cluster-aws-creds
namespace: {{ $cluster.name }}
spec:
dataFrom:
- extract:
conversionStrategy: Default
decodingStrategy: None
key: secret/hub/aws
metadataPolicy: None
refreshInterval: 24h0m0s
secretStoreRef:
kind: ClusterSecretStore
name: vault-backend
target:
creationPolicy: Owner
deletionPolicy: Retain
name: {{ $cluster.name }}-cluster-aws-creds
template:
engineVersion: v2
mergePolicy: Replace
type: Opaque

---
apiVersion: v1
kind: Secret
metadata:
name: {{ $cluster.name }}-cluster-install-config
namespace: {{ $cluster.name }}
type: Opaque
data:
install-config.yaml: {{ toYaml $cluster.install_config | b64enc }}

---
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
name: {{ $cluster.name }}
namespace: {{ $cluster.name }}
labels:
vendor: OpenShift
spec:
baseDomain: {{ $cluster.install_config.baseDomain }}
clusterName: {{ $cluster.name }}
installAttemptsLimit: 1
platform:
{{- if $cluster.install_config.platform.aws }}
aws:
credentialsSecretRef:
name: {{ $cluster.name }}-cluster-aws-creds
region: {{ $cluster.install_config.platform.aws.region }}
{{- end }}
provisioning:
installConfigSecretRef:
name: {{ $cluster.name }}-cluster-install-config
sshPrivateKeySecretRef:
name: {{ $cluster.name }}-cluster-private-key
imageSetRef:
name: img{{ $cluster.version }}-multi-appsub
pullSecretRef:
name: {{ $cluster.name }}-cluster-pull-secret

---
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
metadata:
labels:
cluster.open-cluster-management.io/clusterset: {{ $group.name }}
{{- if (not $group.acmlabels) }}
clusterGroup: {{ $group.name }}
{{- else if eq (len $group.acmlabels) 0 }}
clusterGroup: {{ $group.name }}
{{- else }}
{{- range $group.acmlabels }}
{{ .name }}: {{ .value }}
{{- end }}
{{- end }}
name: {{ $cluster.name }}
spec:
hubAcceptsClient: true

{{- end }}{{- /* range $group.clusterDeployments */}}
{{- end }}{{- /* if $group.clusterDeployments) */}}
{{- end }}{{- /* range .Values.clusterGroup.managedClusterGroups */}}
48 changes: 48 additions & 0 deletions acm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,54 @@ clusterGroup:
# labels:
# - name: clusterGroup
# value: region-one
# testRegionTwo:
# name: region-two
# labels:
# - name: clusterGroup
# value: region-two
# clusterDeployments:
# - name: mcluster1
# version: 4.14.12
# # See OpenShift documentation for install config spec
# # https://docs.openshift.com/container-platform/4.14/installing/installing_aws/installing-aws-customizations.html
# install_config:
# apiVersion: v1
# metadata:
# name: mcluster1
# baseDomain: example-domain.com
# controlPlane:
# name: master
# replicas: 3
# platform:
# aws:
# type: m5.2xlarge
# zones:
# - ca-central-1a
# compute:
# - name: worker
# replicas: 5
# platform:
# aws:
# type: m5.2xlarge
# zones:
# - ca-central-1a
# networking:
# clusterNetwork:
# - cidr: 10.128.0.0/14
# hostPrefix: 23
# machineNetwork:
# - cidr: 10.0.0.0/16
# networkType: OpenShiftSDN
# serviceNetwork:
# - 172.30.0.0/16
# platform:
# aws:
# region: ca-central-1
# userTags:
# project: ValidatedPatterns
# publish: External
# sshKey: ""
# pullSecret: ""

secretStore:
name: vault-backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ metadata:
app.kubernetes.io/instance: hashicorp-vault
app.kubernetes.io/managed-by: Helm
spec:
host:
host: chart-example.local
to:
kind: Service
name: hashicorp-vault
Expand Down
2 changes: 1 addition & 1 deletion tests/hashicorp-vault-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ metadata:
app.kubernetes.io/instance: hashicorp-vault
app.kubernetes.io/managed-by: Helm
spec:
host:
host: chart-example.local
to:
kind: Service
name: hashicorp-vault
Expand Down
2 changes: 1 addition & 1 deletion tests/hashicorp-vault-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ metadata:
app.kubernetes.io/instance: hashicorp-vault
app.kubernetes.io/managed-by: Helm
spec:
host:
host: chart-example.local
to:
kind: Service
name: hashicorp-vault
Expand Down
2 changes: 1 addition & 1 deletion tests/hashicorp-vault-naked.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ metadata:
app.kubernetes.io/instance: hashicorp-vault
app.kubernetes.io/managed-by: Helm
spec:
host:
host: chart-example.local
to:
kind: Service
name: hashicorp-vault
Expand Down
2 changes: 1 addition & 1 deletion tests/hashicorp-vault-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ metadata:
app.kubernetes.io/instance: hashicorp-vault
app.kubernetes.io/managed-by: Helm
spec:
host:
host: chart-example.local
to:
kind: Service
name: hashicorp-vault
Expand Down