From 0fd1b7342ba5626c97f832726567ba73b72aec0b Mon Sep 17 00:00:00 2001 From: babykart Date: Sat, 22 Mar 2025 21:03:52 +0100 Subject: [PATCH 1/2] Add Kubernetes CRD and the related kustomization Signed-off-by: babykart --- script/k8s/crd/garagenodes.deuxfleurs.fr.yaml | 43 +++++++++++++++++++ script/k8s/crd/kustomization.yaml | 5 +++ 2 files changed, 48 insertions(+) create mode 100644 script/k8s/crd/garagenodes.deuxfleurs.fr.yaml create mode 100644 script/k8s/crd/kustomization.yaml diff --git a/script/k8s/crd/garagenodes.deuxfleurs.fr.yaml b/script/k8s/crd/garagenodes.deuxfleurs.fr.yaml new file mode 100644 index 00000000..cd0fb166 --- /dev/null +++ b/script/k8s/crd/garagenodes.deuxfleurs.fr.yaml @@ -0,0 +1,43 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: garagenodes.deuxfleurs.fr +spec: + conversion: + strategy: None + group: deuxfleurs.fr + names: + kind: GarageNode + listKind: GarageNodeList + plural: garagenodes + singular: garagenode + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: Auto-generated derived type for Node via `CustomResource` + properties: + spec: + properties: + address: + format: ip + type: string + hostname: + type: string + port: + format: uint16 + minimum: 0 + type: integer + required: + - address + - hostname + - port + type: object + required: + - spec + title: GarageNode + type: object + served: true + storage: true + subresources: {} \ No newline at end of file diff --git a/script/k8s/crd/kustomization.yaml b/script/k8s/crd/kustomization.yaml new file mode 100644 index 00000000..9f20eccf --- /dev/null +++ b/script/k8s/crd/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- garagenodes.deuxfleurs.fr.yaml \ No newline at end of file From b15e2cbb6ccc044b868cd8c56306c0b3a34610fa Mon Sep 17 00:00:00 2001 From: babykart Date: Sat, 22 Mar 2025 23:44:55 +0100 Subject: [PATCH 2/2] Update Kubernetes cookbook Signed-off-by: babykart --- doc/book/cookbook/kubernetes.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/book/cookbook/kubernetes.md b/doc/book/cookbook/kubernetes.md index af04e94d..1e7674d7 100644 --- a/doc/book/cookbook/kubernetes.md +++ b/doc/book/cookbook/kubernetes.md @@ -26,6 +26,13 @@ Or deploy with custom values: helm install --create-namespace --namespace garage garage ./garage -f values.override.yaml ``` +If you want to manage the CustomRessourceDefinition used by garage for its `kubernetes_discovery` outside of the helm chart, add `garage.kubernetesSkipCrd: true` to your custom values and use the kustomization before deploying the helm chart: + +```bash +kubectl apply -k ../k8s/crd +helm install --create-namespace --namespace garage garage ./garage -f values.override.yaml +``` + After deploying, cluster layout must be configured manually as described in [Creating a cluster layout](@/documentation/quick-start/_index.md#creating-a-cluster-layout). Use the following command to access garage CLI: ```bash