Addons

Addons are specific services and tools extending the functionality of Kubernetes.

Comparison To KKP Applications

While sharing a similar goal, KKP Applications and KKP Addons differ in scope and complexity:

KKP Applications provide an integration using established Kubernetes Technologies to deploy Application workload and configuration. They are a great choice for leveraging Kubernetes community contributions or basing your own applications on them. For example to deploy the popular monitoring solution Prometheus, you can make use of the community-developed Prometheus Helm Chart and do not have to package the application yourself. Furthermore, Applications integrate seamlessly into the KKP lifecycle and can be stored in KKP Cluster Templates for re-usability.

KKP Addons on the other hand, are powerful extensions which can not only deploy workload and configuration into a cluster, but also change the underlying functionality of the cluster itself. The majority of KKP addons are provided directly by Kubermatic. Addons are a great choice if you want to extend the functionality of your cluster and when you need access to lower-level functionality.

In general, we recommend the usage of Applications for workloads running inside a cluster and recommend to use Addons when specific lower-level capabilities are required (e.g. making changes to nodes of a cluster or changing network interfaces).

Default Addons

Default addons are installed in each user-cluster in KKP. The default addons are:

  • Canal: policy based networking for cloud native applications
  • Dashboard: General-purpose web UI for Kubernetes clusters
  • kube-proxy: Kubernetes network proxy
  • rbac: Kubernetes Role-Based Access Control, needed for TLS node bootstrapping
  • OpenVPN client: virtual private network (VPN). Lets the control plan access the Pod & Service network. Required for functionality like kubectl proxy & kubectl port-forward.
  • pod-security-policy: Policies to configure KKP access when PSPs are enabled
  • default-storage-class: A cloud provider specific StorageClass
  • kubeadm-configmap & kubelet-configmap: A set of ConfigMaps used by kubeadm

Installation and configuration of these addons is done by 2 controllers which are part of the KKP seed-controller-manager:

  • addon-installer-controller: Ensures a given set of addons will be installed in all clusters
  • addon-controller: Templates the addons & applies the manifests in the user clusters

The KKP binaries come with a kubermatic-installer tool, which can output a full default KubermaticConfiguration (kubermatic-installer print). This will also include the default configuration for addons and can serve as a starting point for adjustments.

apiVersion: kubermatic.k8c.io/v1
kind: KubermaticConfiguration
metadata:
  name: kubermatic
  namespace: kubermatic
spec:
  userCluster:
    addons:
      # DefaultManifests is a list of addon manifests to install into all clusters.
      # Mutually exclusive with "default".
      defaultManifests: [...]
      # DockerRepository is the repository containing the Docker image containing
      # the possible addon manifests.
      dockerRepository: quay.io/kubermatic/addons
      # DockerTagSuffix is appended to the tag used for referring to the addons image.
      # If left empty, the tag will be the KKP version (e.g. "v2.15.0"), with a
      # suffix it becomes "v2.15.0-SUFFIX".
      dockerTagSuffix: ""
[...]

Configuration

To configure which addons shall be installed in all user clusters, update the relevant KubermaticConfiguration in the spec.userCluster.addons section. You can configure a Docker image that contains the required addon manifests (as YAML files) and an AddonList manifest that lists the addons and their requirements. Take a look at the default configuration above as a starting point.

To deploy any changes, edit the KubermaticConfiguration in-place using kubectl edit or apply it from a file using kubectl apply. The KKP Operator will reconcile the installation and after a few moments your changes will take effect.

Accessible Addons

Accessible addons can be installed in each user-cluster in KKP on user demand (in contrast to regular addons, which are always installed and cannot be removed by the user). If an addon is both default and accessible, then it will be installed in the user-cluster, but also be visible to the user, who can manage it from the KKP dashboard like the other accessible addons. The accessible addons are:

Accessible addons can be managed in the UI from the cluster details view:

Addons

Configuration

To configure which addons shall be accessible, set the spec.api.accessibleAddons field inside the KubermaticConfiguration:

spec:
  api:
    accessibleAddons:
      - node-exporter

The dashboard’s view for managing addons can be configured by creating an AddonConfig custom resources. This can be used to control the addon’s icon, description and form fields to ask for rudimentary user input. It’s recommended to create an AddonConfig for each accessible addon.

AddonConfig resources are not namespaced. Make sure to not mix up addon configs if you run multiple KKP installations in the same cluster (which is not a recommended setup).

The following demonstrates an AddonConfig for the node-exporter addon. It configures a description and logo as well as some form fields (which in this case are not used by the addon itself).

apiVersion: kubermatic.k8c.io/v1
kind: AddonConfig
metadata:
  name: node-exporter
spec:
  description: "The Prometheus Node Exporter exposes a wide variety of hardware- and kernel-related metrics."
  logoFormat: "svg+xml"
  # The logo must be base64 encoded.
  logo: |+
    PHN2ZyB3aWR0aD0iMTY2IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMTY2IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0
    cDovL3d3dy53My5vcm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Name: Replicas
      internalName: replicas
      required: true
      type: number
      helpText: "Number of replicas."
    - displayName: Description
      internalName: desc
      required: false
      type: text
    - displayName: Debug
      internalName: debug
      required: false
      type: boolean
    - displayName: Spec
      internalName: spec
      required: false
      type: text-area
      helpText: "Use YAML format."

There is a short explanation of the single formSpec fields:

  • displayName is the name that is displayed in the UI as the control label.
  • internalName is the name used internally. It can be referenced with template variables (see the description below).
  • required indicates if the control should be required in the UI.
  • type indicates type of the control that will be displayed in the UI. Can be one of number, text, boolean and text-area.
  • helpText is the text that will be displayed in the UI next to the control. It can contain some hints for the end-users.

Each of the fields from the formSpec is then available using the .Variables template variable. See the section below for more information.

After applying above config the UI should look like below:

Addon Form

Custom Addons

All manifests and config files for the default addons are stored in a Docker image, whose name is configured in the KubermaticConfiguration at spec.userClusters.addons.dockerRepository. This defaults to quay.io/kubermatic/addons.

Creating a Docker Image

It is recommended to choose the default image as the basis for your own image to include default addons. All addon manifest are stored in /addons/<addonname>, e.g. /addons/kube-proxy. When creating your own image, copy the manifests into a directory below /addons.

Suppose you have this directory structure:

.
├─ Dockerfile
└─ my-custom-addon
   └─ deployment.yaml

A simple Dockerfile would be

FROM quay.io/kubermatic/addons:YOUR_KUBERMATIC_VERSION

ADD ./ /addons/

You can then build and push your customized addon image to a Docker registry of your choice:

export TAG=YOUR_KUBERMATIC_VERSION
docker build -t customer/addons:${TAG} .
docker push customer/addons:${TAG}

Manifest Templating

KKP treats each file in an addon directory (/addon/<addonname>) as a Go template, so it is possible to inject dynamic and user-cluster related information into addons at runtime. Please refer to the Go documentation for the exact templating syntax.

KKP injects an instance of the TemplateData struct into each template. The following Go snippet shows the available information:

// TemplateData is the root context injected into each addon manifest file.
type TemplateData struct {
	SeedName       string
	DatacenterName string
	Cluster        ClusterData
	Credentials    Credentials
	Variables      map[string]interface{}
}

// ClusterData contains data related to the user cluster
// the addon is rendered for.
type ClusterData struct {
	// Type is only "kubernetes"
	Type string
	// Name is the auto-generated, internal cluster name, e.g. "bbc8sc24wb".
	Name string
	// HumanReadableName is the user-specified cluster name.
	HumanReadableName string
	// Namespace is the full namespace for the cluster's control plane.
	Namespace string
	// OwnerName is the owner's full name.
	OwnerName string
	// OwnerEmail is the owner's e-mail address.
	OwnerEmail string
	// Labels are the labels users have configured for their cluster, including
	// system-defined labels like the project ID.
	Labels map[string]string
	// Annotations are the annotations on the cluster resource, usually
	// cloud-provider related information like regions.
	Annotations map[string]string
	// Kubeconfig is a YAML-encoded kubeconfig with cluster-admin permissions
	// inside the user-cluster. The kubeconfig uses the external URL to reach
	// the apiserver.
	Kubeconfig string

	// ClusterAddress stores access and address information of a cluster.
	Address kubermaticv1.ClusterAddress

	// CloudProviderName is the name of the cloud provider used, one of
	// "alibaba", "aws", "azure", "bringyourown", "digitalocean", "gcp",
	// "hetzner", "kubevirt", "openstack", "packet", "vsphere" depending on
	// the configured datacenters.
	CloudProviderName string
	// Version is the exact current cluster version.
	Version *semverlib.Version
	// MajorMinorVersion is a shortcut for common testing on "Major.Minor" on the
	// current cluster version.
	MajorMinorVersion string
	// Network contains DNS and CIDR settings for the cluster.
	Network ClusterNetwork
	// Features is a set of enabled features for this cluster.
	Features sets.Set[string]
	// CNIPlugin contains the CNIPlugin settings
	CNIPlugin CNIPlugin
	// CSI specific options, dependent on provider
	CSI CSIOptions
	// MLA contains monitoring, logging and alerting related settings for the user cluster.
	MLA MLASettings
	// CSIMigration indicates if the cluster needed the CSIMigration
	CSIMigration bool
	// KubeVirtInfraStorageClasses is a list of storage classes from KubeVirt infra cluster that are used for
	// initialization of user cluster storage classes by the CSI driver kubevirt (hot pluggable disks)
	KubeVirtInfraStorageClasses []kubermaticv1.KubeVirtInfraStorageClass
	// DisableCSIDriver indicates if csi drivers (csi addon) is disabled for the user cluster or not.
	DisableCSIDriver bool
}

// ClusterAddress stores access and address information of a cluster.
type ClusterAddress struct {
	// URL under which the Apiserver is available
	// +optional
	URL string `json:"url"`
	// Port is the port the API server listens on
	// +optional
	Port int32 `json:"port"`
	// ExternalName is the DNS name for this cluster
	// +optional
	ExternalName string `json:"externalName"`
	// InternalName is the seed cluster internal absolute DNS name to the API server
	// +optional
	InternalName string `json:"internalURL"`
	// AdminToken is the token for the kubeconfig, the user can download
	// +optional
	AdminToken string `json:"adminToken"`
	// IP is the external IP under which the apiserver is available
	// +optional
	IP string `json:"ip"`
	// APIServerExternalAddress is the external address of the API server (IP or DNS name)
	// This field is populated only when the API server service is of type LoadBalancer. If set, this address will be used in the
	// kubeconfig for the user cluster that can be downloaded from the KKP UI.
	// +optional
	APIServerExternalAddress string `json:"apiServerExternalAddress,omitempty"`
}

type ClusterNetwork struct {
	DNSDomain            string
	DNSClusterIP         string
	DNSResolverIP        string
	PodCIDRBlocks        []string
	ServiceCIDRBlocks    []string
	ProxyMode            string
	StrictArp            *bool
	DualStack            bool
	PodCIDRIPv4          string
	PodCIDRIPv6          string
	NodeCIDRMaskSizeIPv4 int32
	NodeCIDRMaskSizeIPv6 int32
	IPAMAllocations      map[string]IPAMAllocation
	NodePortRange        string
}

type CNIPlugin struct {
	Type    string
	Version string
}

type CSIOptions struct {

	// vsphere
	// StoragePolicy is the storage policy to use for vsphere csi addon
	StoragePolicy string

	// nutanix
	StorageContainer        string
	Fstype                  string
	SsSegmentedIscsiNetwork *bool

	// vmware Cloud Director
	StorageProfile string
	Filesystem     string

	// openstack
	CinderTopologyEnabled bool
}

type MLASettings struct {
	// MonitoringEnabled is the flag for enabling monitoring in user cluster.
	MonitoringEnabled bool
	// LoggingEnabled is the flag for enabling logging in user cluster.
	LoggingEnabled bool
}

type Credentials struct {
	AWS                 AWSCredentials
	Azure               AzureCredentials
	Baremetal           BaremetalCredentials
	Digitalocean        DigitaloceanCredentials
	GCP                 GCPCredentials
	Hetzner             HetznerCredentials
	Openstack           OpenstackCredentials
	Packet              PacketCredentials
	Kubevirt            KubevirtCredentials
	VSphere             VSphereCredentials
	Alibaba             AlibabaCredentials
	Anexia              AnexiaCredentials
	Nutanix             NutanixCredentials
	VMwareCloudDirector VMwareCloudDirectorCredentials
}

type AWSCredentials struct {
	AccessKeyID          string
	SecretAccessKey      string
	AssumeRoleARN        string
	AssumeRoleExternalID string
}

type AzureCredentials struct {
	TenantID       string
	SubscriptionID string
	ClientID       string
	ClientSecret   string
}

type BaremetalCredentials struct {
	Tinkerbell TinkerbellCredentials
}

type TinkerbellCredentials struct {
	// Admin kubeconfig for Tinkerbell cluster
	Kubeconfig string
}

type DigitaloceanCredentials struct {
	Token string
}

type GCPCredentials struct {
	ServiceAccount string
}

type HetznerCredentials struct {
	Token string
}

type OpenstackCredentials struct {
	Username                    string
	Password                    string
	Project                     string
	ProjectID                   string
	Domain                      string
	ApplicationCredentialID     string
	ApplicationCredentialSecret string
	Token                       string
}

type PacketCredentials struct {
	APIKey    string
	ProjectID string
}

type KubevirtCredentials struct {
	// Admin kubeconfig for KubeVirt cluster
	KubeConfig string
}

type VSphereCredentials struct {
	Username string
	Password string
}

type AlibabaCredentials struct {
	AccessKeyID     string
	AccessKeySecret string
}

type AnexiaCredentials struct {
	Token string
}

type NutanixCredentials struct {
	Username    string
	Password    string
	CSIUsername string
	CSIPassword string
	ProxyURL    string
}

type VMwareCloudDirectorCredentials struct {
	Username     string
	Password     string
	APIToken     string
	Organization string
	VDC          string
}


KKP also injects Sprig functions and the following custom functions into templates:

When referencing a Docker registry, it’s recommended to use the Registry(string) string helper function, which takes the registry override functionality for the KKP API into account.

{{ Registry "quay.io" }}/some-org/some-app:v1.0

The above will return quay.io when no override is set, otherwise the overridden registry.

Configure KKP

It’s now time to configure KKP to use your Docker image instead of its default, and to tell it about your new addon. By default, the KKP Operator will use the KKP version for the Docker image tag (so if you configure docker.io/example/my-addons as the repository, the final image name will be docker.io/example/my-addons:KKP_VERSION). To help with developing custom addons, it is however possible to define an additional suffix for the image tag, which will be appended to the KKP version with a dash (i.e. docker.io/example/my-addons:KKP_VERSION-YOUR_SUFFIX).

This versioning scheme ensures that admins can easily roll out new Docker images for their addons, but also that updating the Docker image is not accidentally forgotten when updating KKP itself.

Edit the KubermaticConfiguration and update the Docker repository for example for Kubernetes:

spec:
  userCluster:
    addons:
      # Do not specify a tag here, as the KKP Operator will always use the KKP
      # version instead.
      dockerRepository: docker.io/customer/addons

      # Leave this empty if you have not created your own Docker images, otherwise this
      # can be used to force pulling a new image whenever KKP is updated.
      # With this exact configuration (assuming KKP v2.15.1 is used), the final image name
      # will be "docker.io/customer/addons:v2.15.1-1".
      dockerTagSuffix: '1'

You also need to add your new addon to the defaultManifests:

spec:
  userCluster:
    addons:
      defaultManifests: |-
        apiVersion: v1
        kind: List
        items:

        # add your new addon here
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: my-custom-addon

        # remember to keep the original default addons, or else user clusters will
        # be defunct
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: canal
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: cilium
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: csi
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: kube-proxy
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: openvpn
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: rbac
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: kubeadm-configmap
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: kubelet-configmap
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: default-storage-class
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: pod-security-policy
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: aws-node-termination-handler
            labels:
              addons.kubermatic.io/ensure: true
        - apiVersion: kubermatic.k8c.io/v1
          kind: Addon
          metadata:
            name: azure-cloud-node-manager
            labels:
              addons.kubermatic.io/ensure: true        

If you want to define the addon as accessible (i.e. configurable), add it to the spec.api.accessibleAddons list.

After updating the KubermaticConfiguration, the changes will take effect after a few moments.