cluster-api-provider-kind

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: Apache-2.0, MIT Imports: 12 Imported by: 0

README

cluster-api-provider-kind

Cluster API provider for KinD or CAPK (pronounced cap-cake) is a provider for creating Kubernetes clusters using KinD and Cluster API.

Description

This is an infrastructure provider for CAPI using kind to generate the cluster. It is intended to be used as an example and for testing purposes

In order to test the provider inside another kind cluster you need to hack a little the kind "bootstrap" cluster.

Getting Started

Create a boostrap cluster with kind hacked with docker(with examples/bootstrap-cluster.yaml:

kind create cluster --config examples/bootstrap-cluster.yaml

Configure clusterctl to use the repo of this cluster-api-provider-kind:

$ cat ~/.cluster-api/clusterctl.yaml

providers:
  - name: "kind"
    url: "https://github.com/mbovo/cluster-api-provider-kind/releases/latest/infrastructure-components.yaml"
    type: "InfrastructureProvider"

Boostrap cluster-api:

KIND_DOCKER_FSGROUPset the securityContext fsGroup to make docker works inside the kind node. Must be set to the group used by docker on the underneath host. You can get it with getent group docker on the underneath host.(e.g. your linux host or the VM where docker runs on MacOS) The default (101) is the one used by coLima in macOs.


```bash
export KIND_DOCKER_FSGROUP=101
clusterctl init --core cluster-api  --infrastructure kind -v5

Generate KindCluster:

clusterctl generate cluster my-cluster --kubernetes-version v1.24.7 --control-plane-machine-count=1 --worker-machine-count=1 -i kind:v0.1.5 | kubectl apply -f -

Improvements

  • [ ] Add errors to the status as per Infrastucture provider contract
  • Export created cluster Kubeconfig to the end user
  • Automatically retrieve kind images given a Kubernetes version
  • Add a ControlPlane provider to configure the controlplane and stopping Kind before starting Kubernetes (using create option CreateWithStopBeforeSettingUpKubernetes)

Pitfails

Github rate limiting

When downloading manifest with clusterctl you can hit the github rate limit. You can set your GITHUB_TOKEN env variable to avoid this.

License

Copyright 2022 Manuel Bovo.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1beta1
Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +kubebuilder:object:generate=true +groupName=infrastructure.cluster.x-k8s.io
Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +kubebuilder:object:generate=true +groupName=infrastructure.cluster.x-k8s.io
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL