From 12dc1f7493f003adbf233820b3835b0a35cccd40 Mon Sep 17 00:00:00 2001 From: Chris Hein Date: Sat, 12 Jun 2021 08:29:18 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Adding=20cluster-template.yaml=20fo?= =?UTF-8?q?r=20clusterctl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chris Hein --- Makefile | 1 + templates/cluster-template.yaml | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 templates/cluster-template.yaml diff --git a/Makefile b/Makefile index fe08478e..7cdfee37 100644 --- a/Makefile +++ b/Makefile @@ -350,6 +350,7 @@ release-manifests: $(RELEASE_DIR) $(KUSTOMIZE) ## Builds the manifests to publis cat $(RELEASE_DIR)/control-plane-components.yaml >> $(RELEASE_DIR)/cluster-api-provider-nested-components.yaml # Add metadata to the release artifacts cp metadata.yaml $(RELEASE_DIR)/metadata.yaml + cp templates/cluster-template*.yaml $(RELEASE_DIR)/ .PHONY: release-staging diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml new file mode 100644 index 00000000..dfb66ddf --- /dev/null +++ b/templates/cluster-template.yaml @@ -0,0 +1,69 @@ +--- +apiVersion: cluster.x-k8s.io/v1alpha4 +kind: Cluster +metadata: + name: "${CLUSTER_NAME}" +spec: + controlPlaneEndpoint: + # currently this has to be the in-cluster endpoint, the in-cluster + # kubeconfig is used by controller-manager w/ ClusterIP services + # we can `port-forward` this service and be able to test + host: "${CLUSTER_NAME}-apiserver" + port: 6443 + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + kind: NestedCluster + name: "${CLUSTER_NAME}" + controlPlaneRef: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + kind: NestedControlPlane + name: "${CLUSTER_NAME}-control-plane" + +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +kind: NestedCluster +metadata: + name: "${CLUSTER_NAME}" +spec: + controlPlaneEndpoint: + host: "localhost" + port: 6443 +--- +apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +kind: NestedControlPlane +metadata: + name: "${CLUSTER_NAME}-control-plane" +spec: + etcd: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + kind: NestedEtcd + name: "${CLUSTER_NAME}-nestedetcd" + apiserver: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + kind: NestedAPIServer + name: "${CLUSTER_NAME}-nestedapiserver" + controllerManager: + apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + kind: NestedControllerManager + name: "${CLUSTER_NAME}-nestedcontrollermanager" +--- +apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +kind: NestedEtcd +metadata: + name: "${CLUSTER_NAME}-nestedetcd" +spec: + replicas: 1 +--- +apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +kind: NestedAPIServer +metadata: + name: "${CLUSTER_NAME}-nestedapiserver" +spec: + replicas: 1 +--- +apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +kind: NestedControllerManager +metadata: + name: "${CLUSTER_NAME}-nestedcontrollermanager" +spec: + replicas: 1