This tutorial introduces how to create a nested controlplane from source code for development. CAPN should work with any standard Kubernetes cluster out of box, but for demo purposes, in this tutorial, we will use a kind cluster as the management cluster as well as the nested workload cluster.
Prerequisites
Please install the latest version of kind and kubectl
Create kind cluster
kind create cluster --name=capn
Clone CAPN
git clone https://github.com/kubernetes-sigs/cluster-api-provider-nested
cd cluster-api-provider-nested
Install cert-manager
Cert Manager is a soft dependency for the Cluster API components to enable mutating and validating webhooks to be auto deployed. For more detailed instructions go Cert Manager Installion.
As a cluster API~(CAPI) provider, CAPN requires core components of CAPI to be setup. We need to deploy the unreleased version of CAPI for v1alpha4 API support.
git clone git@github.com:kubernetes-sigs/cluster-api.git
cd cluster-api
make release-manifests
# change feature flags on core
sed -i'' -e 's@- --feature-gates=.*@- --feature-gates=MachinePool=false,ClusterResourceSet=true@' out/core-components.yaml
kubectl apply -f out/core-components.yaml
cd ..
To use the KUBECONFIG created by clusterctl without modification, we first
need to setup a host record for the apiserver service name, to do this need add
following line to /etc/hosts.
Quota finished
Finished quota
Table of Contents generated with DocToc
kind
clustercert-manager
KUBECONFIG
Development Quick Start
This tutorial introduces how to create a nested controlplane from source code for development. CAPN should work with any standard Kubernetes cluster out of box, but for demo purposes, in this tutorial, we will use a
kind
cluster as the management cluster as well as the nested workload cluster.Prerequisites
Please install the latest version of kind and kubectl
Create
kind
clusterClone CAPN
Install
cert-manager
Cert Manager is a soft dependency for the Cluster API components to enable mutating and validating webhooks to be auto deployed. For more detailed instructions go Cert Manager Installion.
Clone CAPI and Deploy Dev release
As a cluster API~(CAPI) provider, CAPN requires core components of CAPI to be setup. We need to deploy the unreleased version of CAPI for
v1alpha4
API support.Create Docker Images, Manifests and Load Images
Deploy CAPN
Next, we will deploy the CAPN related CRDs and controllers.
Apply Sample Cluster
Get
KUBECONFIG
We will use the
clusterctl
command-line tool to generate theKUBECONFIG
, which will be used to access the nested controlplane later.Port Forward
To access the nested controlplane, in a separate shell, you will need to
port-forward
the apiserver service.Connect to Cluster
To use the
KUBECONFIG
created byclusterctl
without modification, we first need to setup a host record for the apiserver service name, to do this need add following line to/etc/hosts
.Connect to the Cluster! :tada:
Clean Up