Skip to content

Commit

Permalink
Make schema compatible with cluster-aws (#26)
Browse files Browse the repository at this point in the history
* Move .Values.global.managementCluster

Move from .Values.global.metadata.managementCluster to .Values.global.managementCluster

* Make schema compatible with cluster-aws

* Fix CI values
  • Loading branch information
nprokopic authored Dec 1, 2023
1 parent fb6519a commit afa7324
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
6 changes: 3 additions & 3 deletions helm/cluster/ci/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
global:
managementCluster: giantmc
metadata:
name: awesome
organization: giantswarm
description: "Awesome Giant Swarm cluster"
managementCluster: giantmc
labels:
some-cluster-label: label-1
another-cluster-label: label-2
Expand Down Expand Up @@ -51,8 +51,8 @@ global:
nodeLabels:
workload-type: robots
components:
cri:
registries:
containerd:
containerRegistries:
docker.io:
- endpoint: registry-1.docker.io
credentials:
Expand Down
6 changes: 3 additions & 3 deletions helm/cluster/files/etc/containerd/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "{{ $.Values.internal.components.cri.sandboxContainerImage.registry }}/{{ $.Values.internal.components.cri.sandboxContainerImage.name }}:{{ $.Values.internal.components.cri.sandboxContainerImage.tag }}"
sandbox_image = "{{ $.Values.internal.components.containerd.sandboxContainerImage.registry }}/{{ $.Values.internal.components.containerd.sandboxContainerImage.name }}:{{ $.Values.internal.components.containerd.sandboxContainerImage.tag }}"

[plugins."io.containerd.grpc.v1.cri".registry]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
{{- range $host, $config := $.Values.global.components.cri.registries }}
{{- range $host, $config := $.Values.global.components.containerd.containerRegistries }}
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{$host}}"]
endpoint = [
{{- range $value := $config -}}
Expand All @@ -34,7 +34,7 @@ sandbox_image = "{{ $.Values.internal.components.cri.sandboxContainerImage.regis
]
{{- end }}
[plugins."io.containerd.grpc.v1.cri".registry.configs]
{{ range $host, $config := $.Values.global.components.cri.registries -}}
{{ range $host, $config := $.Values.global.components.containerd.containerRegistries -}}
{{ range $value := $config -}}
{{ with $value.credentials -}}
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{$value.endpoint}}".auth]
Expand Down
4 changes: 2 additions & 2 deletions helm/cluster/files/etc/teleport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ ssh_service:
command: [/opt/teleport-node-role.sh]
period: 1m0s
labels:
mc: {{ .Values.global.metadata.managementCluster }}
mc: {{ .Values.global.managementCluster }}
{{- $clusterName := include "cluster.resource.name" $ }}
{{- if ne .Values.managementCluster $clusterName }}
{{- if ne .Values.global.managementCluster $clusterName }}
cluster: {{ include "cluster.resource.name" $ }}
{{- end }}
baseDomain: {{ .Values.global.connectivity.baseDomain }}
Expand Down
35 changes: 16 additions & 19 deletions helm/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,27 +515,24 @@
"controlPlane",
"metadata"
],
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"components": {
"type": "object",
"title": "Components",
"description": "Advanced configuration of machine and cluster components.",
"required": [
"cri"
],
"description": "Advanced configuration of components that are running on all nodes.",
"additionalProperties": false,
"properties": {
"cri": {
"containerd": {
"type": "object",
"title": "CRI (container runtime interface)",
"description": "Configuration of container runtime interface.",
"title": "Containerd",
"description": "Configuration of containerd.",
"required": [
"registries"
"containerRegistries"
],
"additionalProperties": false,
"properties": {
"registries": {
"containerRegistries": {
"type": "object",
"title": "Container registries",
"description": "Endpoints and credentials configuration for container registries.",
Expand Down Expand Up @@ -860,6 +857,11 @@
}
}
},
"managementCluster": {
"type": "string",
"title": "Management cluster",
"description": "Name of the Cluster API cluster managing this workload cluster."
},
"metadata": {
"type": "object",
"title": "Metadata",
Expand Down Expand Up @@ -904,11 +906,6 @@
}
}
},
"managementCluster": {
"type": "string",
"title": "Management cluster",
"description": "Name of the Cluster API cluster managing this workload cluster."
},
"name": {
"type": "string",
"title": "Cluster name",
Expand Down Expand Up @@ -1063,14 +1060,14 @@
"title": "Components",
"description": "Internal configuration of various components that form the Kubernetes cluster.",
"required": [
"cri"
"containerd"
],
"additionalProperties": false,
"properties": {
"cri": {
"containerd": {
"type": "object",
"title": "CRI (container runtime interface)",
"description": "Configuration of container runtime interface.",
"title": "Containerd",
"description": "Configuration of containerd.",
"required": [
"sandboxContainerImage"
],
Expand Down
6 changes: 3 additions & 3 deletions helm/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

global:
components:
cri:
registries:
containerd:
containerRegistries:
docker.io:
- endpoint: registry-1.docker.io
- endpoint: giantswarm.azurecr.io
Expand Down Expand Up @@ -37,7 +37,7 @@ internal:
storage: {}
systemd: {}
components:
cri:
containerd:
sandboxContainerImage:
name: giantswarm/pause
registry: quay.io
Expand Down

0 comments on commit afa7324

Please sign in to comment.