Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Resource specifications for all klusterlet-managed containers.
| `fleetConfig.registrationAuth.driver` | The authentication driver to use (default: "csr"). Set to "awsirsa" to use AWS IAM Roles for Service Accounts (IRSA) for EKS FleetConfigs. | `csr` |
| `fleetConfig.registrationAuth.hubClusterARN` | The ARN of the hub cluster. This is only required if configuring an EKS FleetConfig. Example: "arn:aws:eks:us-west-2:<HUB_AWS_ACCOUNT_ID>:cluster/<HUB_CLUSTER_NAME>". | `""` |
| `fleetConfig.registrationAuth.autoApprovedARNPatterns` | Optional list of spoke cluster name ARN patterns that the hub will auto-approve. | `[]` |
| `fleetConfig.hub.addOnConfigs` | Global add-on configuration for the hub cluster. | `[]` |
| `fleetConfig.hub.clusterManager.enabled` | Whether to enable the cluster manager. Set to false if using Singleton Control Plane. | `true` |
| `fleetConfig.hub.clusterManager.featureGates.DefaultClusterSet` | DefaultClusterSet feature gate. | `true` |
| `fleetConfig.hub.clusterManager.featureGates.ManifestWorkReplicaSet` | ManifestWorkReplicaSet feature gate. | `true` |
Expand Down Expand Up @@ -135,7 +136,6 @@ Resource specifications for all klusterlet-managed containers.
| `fleetConfig.spokes[0].klusterlet.singleton` | If true, deploy klusterlet in singleton mode, with registration and work agents running in a single pod. This is an alpha stage flag. | `false` |
| `fleetConfig.spokes[0].klusterlet.values` | Values to pass to the klusterlet Helm chart. | `{}` |
| `fleetConfig.spokes[0].addOns` | Add-on configuration for the spoke clusters. | `[]` |
| `fleetConfig.addOnConfigs` | Global add-on configuration for the hub cluster. | `[]` |

### Topology Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,46 @@ Works with arbitrary depth and handles maps, slices, and scalar values.
*/}}
{{- define "deepClean" -}}
{{- if and . (kindIs "map" .) -}}
{{- $clean := dict -}}
{{- range $key, $value := . -}}
{{- if $value -}}
{{- $clean := dict -}}
{{- range $key, $value := . -}}
{{- if kindIs "map" $value -}}
{{- $cleanedValue := include "deepClean" $value | fromYaml -}}
{{- if $cleanedValue -}}
{{- $clean = set $clean $key $cleanedValue -}}
{{- $cleaned := include "deepClean" $value | fromYaml -}}
{{- if $cleaned -}}
{{- $clean = set $clean $key $cleaned -}}
{{- end -}}
{{- else if kindIs "slice" $value -}}
{{- $cleanArray := list -}}
{{- $arr := list -}}
{{- range $value -}}
{{- if and . (ne . "") -}}
{{- $cleanArray = append $cleanArray . -}}
{{- if kindIs "map" . -}}
{{- $ec := include "deepClean" . | fromYaml -}}
{{- if $ec -}}
{{- $arr = append $arr $ec -}}
{{- end -}}
{{- else if kindIs "string" . -}}
{{- if ne (trim .) "" -}}
{{- $arr = append $arr . -}}
{{- end -}}
{{- else -}}
{{- $arr = append $arr . -}}
{{- end -}}
{{- end -}}
{{- if $cleanArray -}}
{{- $clean = set $clean $key $cleanArray -}}
{{- if $arr -}}
{{- $clean = set $clean $key $arr -}}
{{- end -}}
{{- else if ne $value "" -}}
{{- else if kindIs "string" $value -}}
{{- if ne (trim $value) "" -}}
{{- $clean = set $clean $key $value -}}
{{- end -}}
{{- else -}}
{{- $clean = set $clean $key $value -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $clean }}{{- $clean | toYaml }}{{- else }}{}{{- end -}}
{{- if $clean -}}
{{ $clean | toYaml -}}
{{- else -}}
{}
{{- end -}}
{{- else -}}
{}
{}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ spec:
registry: {{ .Values.fleetConfig.source.registry }}
{{- end }}
{{- if (.Values.fleetConfig.hub.singletonControlPlane | default dict).enabled }}
singleton: {{- toYaml .Values.fleetConfig.hub.singletonControlPlane | nindent 6 }}
{{- $scp := omit .Values.fleetConfig.hub.singletonControlPlane "enabled" -}}
singleton: {{- toYaml $scp | nindent 6 }}
{{- end }}
createNamespace: {{ .Values.fleetConfig.hub.createNamespace }}
force: {{ .Values.fleetConfig.hub.force }}
{{- with .Values.fleetConfig.hub.kubeconfig }}
kubeconfig:
context: {{ .context | quote }}
inCluster: {{ .inCluster }}
{{- if .secretReference }}
{{- if and .secretReference (not (empty .secretReference.name)) }}
secretReference: {{ toYaml .secretReference | nindent 8 }}
{{- end }}
{{- end }}
Expand All @@ -57,7 +58,7 @@ spec:
kubeconfig:
context: {{ .context | quote }}
inCluster: {{ .inCluster }}
{{- if .secretReference }}
{{- if and .secretReference (not (empty .secretReference.name)) }}
secretReference: {{ toYaml .secretReference | nindent 10 }}
{{- end }}
{{- end }}
Expand All @@ -80,12 +81,13 @@ spec:
forceInternalEndpointLookup: {{ .klusterlet.forceInternalEndpointLookup }}
forceInternalEndpointLookupManaged: {{ .klusterlet.forceInternalEndpointLookupManaged }}
singleton: {{ .klusterlet.singleton }}
{{- with .klusterlet.managedClusterKubeconfig }}
{{- $mck := .klusterlet.managedClusterKubeconfig -}}
{{- if or $mck.context $mck.inCluster (and $mck.secretReference (not (empty $mck.secretReference.name))) }}
managedClusterKubeconfig:
context: {{ .context | quote }}
inCluster: {{ .inCluster }}
{{- if .secretReference }}
secretReference: {{ toYaml .secretReference | nindent 12 }}
context: {{ $mck.context | quote }}
inCluster: {{ $mck.inCluster }}
{{- if and $mck.secretReference (not (empty $mck.secretReference.name)) }}
secretReference: {{ toYaml $mck.secretReference | nindent 12 }}
{{- end }}
{{- end }}
resources: {{- include "deepClean" .klusterlet.resources | nindent 10 }}
Expand All @@ -99,7 +101,14 @@ spec:
addOns: {{- toYaml .addOns | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.fleetConfig.addOnConfigs }}
addOnConfigs: {{- toYaml .Values.fleetConfig.addOnConfigs | nindent 4 }}
{{- if .Values.fleetConfig.hub.addOnConfigs }}
addOnConfigs:
{{- range .Values.fleetConfig.hub.addOnConfigs }}
- name: {{ .name }}
version: {{ .version }}
clusterRoleBinding: {{ .clusterRoleBinding }}
hubRegistration: {{ .hubRegistration }}
overwrite: {{ .overwrite }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if .Values.fleetConfig.addOnConfigs }}
{{- if .Values.fleetConfig.hub.addOnConfigs }}
{{- $namespace := .Release.Namespace }}
{{- $labels := include "chart.labels" . }}
{{- $annotations := include "chart.annotations" . }}
{{- range .Values.fleetConfig.addOnConfigs }}
{{- range .Values.fleetConfig.hub.addOnConfigs }}
{{ $versionedName := printf "%s-%s" .name .version }}
apiVersion: v1
kind: ConfigMap
Expand Down
17 changes: 8 additions & 9 deletions fleetconfig-controller/charts/fleetconfig-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ fleetConfig:
autoApprovedARNPatterns: []
## Configuration for the Hub cluster.
hub:
## @param fleetConfig.hub.addOnConfigs Global add-on configuration for the hub cluster.
addOnConfigs: []
# - name: "" # Name of the add-on.
# manifests: "" # Manifests to install. Can either be inline or a URL.
# version: "v0.0.1" # Version of the add-on.
# clusterRoleBinding: "" # ClusterRoleBinding to apply to the add-on.
# hubRegistration: false # Enable the agent to register to the hub cluster.
# overwrite: false # Whether to overwrite the add-on if it already exists.
## Configuration for the Cluster Manager on the Hub cluster.
clusterManager:
## @descriptionStart
Expand Down Expand Up @@ -242,15 +250,6 @@ fleetConfig:
# installNamespace: "" # Namespace to install the add-on.
# annotations: {} # Annotations to apply to the add-on.

## @param fleetConfig.addOnConfigs Global add-on configuration for the hub cluster.
addOnConfigs: []
# - name: "" # Name of the add-on.
# manifests: "" # Manifests to install. Can either be inline or a URL.
# version: "v0.0.1" # Version of the add-on.
# clusterRoleBinding: "" # ClusterRoleBinding to apply to the add-on.
# hubRegistration: false # Enable the agent to register to the hub cluster.
# overwrite: false # Whether to overwrite the add-on if it already exists.

## @section Topology Resources

## @param topologyResources.enabled Whether to create Namespaces and ManagedClusterSetBindings for the default ManagedClusterSets created when a FleetConfig is created with the DefaultClusterSet feature gate enabled. Additionally, a Namespace, ManagedClusterSet, and Placement are created for targeting all managed clusters that are not the hub running in hub-as-spoke mode.
Expand Down
23 changes: 12 additions & 11 deletions fleetconfig-controller/test/data/fleetconfig-values.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
fleetConfig:
timeout: 300
logVerbosity: 5
addOnConfigs:
- name: test-addon
version: "v1.0.0"
manifests: |
apiVersion: v1
kind: Namespace
metadata:
name: test-addon
clusterRoleBinding: ""
hubRegistration: false
overwrite: false
spokeAnnotations:
foo: "not-bar"
baz: "quux"
hub:
addOnConfigs:
- name: test-addon
version: "v1.0.0"
manifests: |
apiVersion: v1
kind: Namespace
metadata:
name: test-addon
clusterRoleBinding: ""
hubRegistration: false
overwrite: false
spokes:
- name: hub-as-spoke
createNamespace: true
Expand Down
Loading