kubefed

by joaquinito2051

Helm chartv0.5.2

KubeFed helm chart

About this chart

Table of Contents generated with DocToc

  • Kubernetes Cluster Federation
    • Prerequisites
    • Installing the Chart
    • Uninstalling the Chart
    • Configuration

Kubernetes Cluster Federation

Kubernetes Cluster Federation is a Kubernetes Incubator project. It builds on the sync controller (a.k.a. push reconciler) from Federation v1 to iterate on the API concepts laid down in the brainstorming doc and further refined in the architecture doc. Access to both documents is available to members of the kubernetes-sig-multicluster google group.

Prerequisites

  • Kubernetes 1.13+
  • Helm 3.2+

Installing the Chart

First, add the KubeFed chart repo to your local repository.

$ helm repo add kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts

$ helm repo list
NAME            URL
kubefed-charts   https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts

With the repo added, available charts and versions can be viewed.

$ helm search repo kubefed

Install the chart and specify the version to install with the --version argument. Replace <x.x.x> with your desired version. If you don't want to install CRDs, add a --skip-crds at the end of the line:

$ helm --namespace kube-federation-system upgrade -i kubefed kubefed-charts/kubefed --version=<x.x.x> --create-namespace

Release "kubefed" does not exist. Installing it now.
NAME: kubefed
LAST DEPLOYED: Wed Aug  5 16:03:46 2020
NAMESPACE: kube-federation-system
STATUS: deployed
REVISION: 1
TEST SUITE: None

NOTE: For namespace-scoped deployments (configured with the --set global.scope=Namespaced option in the helm install command): if you created your namespace prior to installing the chart, make sure to add a name: <namespace> label to the namespace using the following command:

kubectl label namespaces <namespace> name=<namespace>

This label is necessary to get proper validation for KubeFed core APIs. If the namespace does not already exist, the helm install command will create the namespace with this label by default.

Uninstalling the Chart

Delete all KubeFed FederatedTypeConfig:

$ kubectl -n kube-federation-system delete FederatedTypeConfig --all

Then you can uninstall/delete the kubefed release:

$ helm --namespace kube-federation-system uninstall kubefed

The command above removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following tables lists the configurable parameters of the KubeFed chart and their default values.

ParameterDescriptionDefault
controllermanager.enabledSpecifies whether to enable the controller manager in KubeFed.true
controllermanager.replicaCountNumber of replicas for KubeFed controller manager.2
controllermanager.repositoryRepo of the KubeFed image.quay.io/kubernetes-multicluster
controllermanager.imageName of the KubeFed image.kubefed
controllermanager.tagTag of the KubeFed image.latest
controllermanager.imagePullPolicyImage pull policy.IfNotPresent
controllermanager.commonTolerationsTolerations for all the pods.[]
controllermanager.commonNodeSelectorNode selector for all the pods.{}
controllermanager.featureGates.PushReconcilerPush reconciler feature.true
controllermanager.featureGates.SchedulerPreferencesScheduler preferences feature.true
controllermanager.featureGates.CrossClusterServiceDiscoveryCross cluster service discovery feature.false
controllermanager.featureGates.FederatedIngressFederated ingress feature.false
controllermanager.clusterAvailableDelayTime to wait before reconciling on a healthy cluster.20s
controllermanager.clusterUnavailableDelayTime to wait before giving up on an unhealthy cluster.60s
controllermanager.leaderElectLeaseDurationThe maximum duration that a leader can be stopped before it is replaced by another candidate.15s
controllermanager.leaderElectRenewDeadlineThe interval between attempts by the acting master to renew a leadership slot before it stops leading. This must be less than or equal to `controllermanager.LeaderElectLeaseDuration.10s
controllermanager.leaderElectRetryPeriodThe duration the clients should wait between attempting acquisition and renewal of a leadership.5s
controllermanager.leaderElectResourceLockThe type of resource object that is used for locking during leader election. Supported options are configmaps and endpoints.configmaps
controllermanager.clusterHealthCheckPeriodHow often to monitor the cluster health.10s
controllermanager.clusterHealthCheckFailureThresholdMinimum consecutive failures for the cluster health to be considered failed after having succeeded.3
controllermanager.clusterHealthCheckSuccessThresholdMinimum consecutive successes for the cluster health to be considered successful after having failed.1
controllermanager.clusterHealthCheckTimeoutDuration after which the cluster health check times out.3s
controllermanager.syncController.adoptResourcesWhether to adopt pre-existing resource in member clusters.Enabled
controllermanager.service.labelsKubernetes labels attached to the controller manager's services{}
controllermanager.certManager.enabledSpecifies whether to enable the usage of the cert-manager for the certificates generation.false
controllermanager.certManager.rootCertificate.organizationsSpecifies the list of organizations to include in the cert-manager generated root certificate.[]
controllermanager.certManager.rootCertificate.commonNameSpecifies the CN value for the cert-manager generated root certificate.ca.webhook.kubefed
controllermanager.certManager.rootCertificate.dnsNamesSpecifies the list of subject alternative names for the cert-manager generated root certificate.["ca.webhook.kubefed"]
global.scopeWhether the KubeFed namespace will be the only target for the control plane.Cluster

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example:

$ helm install kubefed-charts/kubefed --name kubefed --namespace kube-federation-system --values values.yaml --devel

Migration from Helm v2 to v3

Helm v3 has a built-in migration feature which can easy move your current Helm v2 installation to Helm v3.

Download Helm v3 CLI from Release Page.

Convert your kubefed installation to Helm v3:

$ helm 2to3 convert kubefed
2020/08/06 18:50:57 Release "kubefed" will be converted from Helm v2 to Helm v3.
2020/08/06 18:50:57 [Helm 3] Release "kubefed" will be created.
2020/08/06 18:50:57 [Helm 3] ReleaseVersion "kubefed.v1" will be created.
2020/08/06 18:50:58 [Helm 3] ReleaseVersion "kubefed.v1" created.
2020/08/06 18:50:58 [Helm 3] Release "kubefed" created.
2020/08/06 18:50:58 Release "kubefed" was converted successfully from Helm v2 to Helm v3.
2020/08/06 18:50:58 Note: The v2 release information still remains and should be removed to avoid conflicts with the migrated v3 release.
2020/08/06 18:50:58 v2 release information should only be removed using `helm 2to3` cleanup and when all releases have been migrated over.

Check your successful migration:

$ helm -n kube-federation-system list
NAME    NAMESPACE               REVISION        UPDATED                                 STATUS          CHART           APP VERSION
kubefed kube-federation-system  1               2020-08-06 16:49:41.593438079 +0000 UTC deployed        kubefed-0.3.1

Deploy kubefed with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubefed on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkubefed is pinned at v0.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply