Providers configurations¶
Canonical Kubernetes bootstrap and control plane providers (CABPCK and CACPCK) can be configured to aid the cluster admin in reaching the desired state for the workload cluster. In this section we will go through different configurations that each one of these providers expose.
Common configurations¶
The following configurations are available for both bootstrap and control plane providers.
version
¶
Type: string
Required: yes
version
is used to specify the Canonical Kubernetes version installed on the nodes.
Note
The Canonical Kubernetes providers will install the latest patch in the stable
risk
level by default, e.g. 1.30/stable
. Patch versions specified in this
configuration will be ignored.
To install a specific track or risk level, see Install custom Canonical Kubernetes on machines guide.
Example usage:
spec:
version: 1.30
files
¶
Type: struct
Required: no
files
can be used to add new files to the machines or overwrite
existing files.
Fields:
Name |
Type |
Description |
Default |
---|---|---|---|
|
|
Where the file should be created |
|
|
|
Content of the created file |
|
|
|
A reference to a secret containing the content of the file. Overwrites |
|
|
|
Permissions of the file to create, e.g. “0600” |
|
|
|
Encoding of the file to create. One of |
|
|
|
Owner of the file to create, e.g. “root:root” |
|
Example usage:
Using
content
:
spec:
files:
path: "/path/to/my-file"
content: |
#!/bin/bash -xe
echo "hello from my-file
permissions: "0500"
owner: root:root
Using
contentFrom
:
spec:
files:
path: "/path/to/my-file"
contentFrom:
secret:
# Name of the secret in the CK8sBootstrapConfig's namespace to use.
name: my-secret
# Key is the key in the secret's data map for this value.
key: my-key
permissions: "0500"
owner: root:root
bootstrapConfig
¶
Type: struct
Required: no
bootstrapConfig
is configuration override to use upon bootstrapping
nodes. The structure of the bootstrapConfig
is defined in the
Bootstrap configuration file reference.
Fields:
Name |
Type |
Description |
Default |
---|---|---|---|
|
|
Content of the file. If this is set, |
|
|
|
A reference to a secret containing the content of the file |
|
Example usage:
Using
content
:
spec:
bootstrapConfig:
content: |
cluster-config:
network:
enabled: true
dns:
enabled: true
cluster-domain: cluster.local
ingress:
enabled: true
load-balancer:
enabled: true
Using
contentFrom
:
spec:
bootstrapConfig:
contentFrom:
secret:
# Name of the secret in the CK8sBootstrapConfig's namespace to use.
name: my-secret
# Key is the key in the secret's data map for this value.
key: my-key
bootCommands
¶
Type: []string
Required: no
bootCommands
specifies extra commands to run in cloud-init early in the
boot process.
Example usage:
spec:
bootCommands:
- echo "first-command"
- echo "second-command"
preRunCommands
¶
Type: []string
Required: no
preRunCommands
specifies extra commands to run in cloud-init before
k8s-snap setup runs.
Note
preRunCommands
can also be used to install custom Canonical Kubernetes versions
on machines. See Install custom Canonical Kubernetes on machines guide for more info.
Example usage:
spec:
preRunCommands:
- echo "first-command"
- echo "second-command"
postRunCommands
¶
Type: []string
Required: no
postRunCommands
specifies extra commands to run in cloud-init after
k8s-snap setup runs.
Example usage:
spec:
postRunCommands:
- echo "first-command"
- echo "second-command"
airGapped
¶
Type: bool
Required: no
airGapped
is used to signal that we are deploying to an air-gapped
environment. In this case, the provider will not attempt to install
k8s-snap on the machine. The user is expected to install k8s-snap
manually with preRunCommands
, or provide an image
with k8s-snap pre-installed.
Example usage:
spec:
airGapped: true
initConfig
¶
Type: struct
Required: no
initConfig
is configuration for the initialising the cluster features
Fields:
Name |
Type |
Description |
Default |
---|---|---|---|
|
|
Are used to configure the behaviour of the built-in features. |
|
|
|
Specifies whether to enable the default DNS configuration. |
|
|
|
Specifies whether to enable the default local storage. |
|
|
|
Specifies whether to enable the default metrics server. |
|
|
|
Specifies whether to enable the default CNI. |
|
Example usage:
spec:
initConfig:
annotations:
annotationKey: "annotationValue"
enableDefaultDNS: false
enableDefaultLocalStorage: true
enableDefaultMetricsServer: false
enableDefaultNetwork: true
snapstoreProxyScheme
¶
Type: string
Required: no
The snap store proxy domain’s scheme, e.g. “http” or “https” without “://”.
Defaults to http
.
Example usage:
spec:
snapstoreProxyScheme: "https"
snapstoreProxyDomain
¶
Type: string
Required: no
The snap store proxy domain.
Example usage:
spec:
snapstoreProxyDomain: "my.proxy.domain"
snapstoreProxyID
¶
Type: string
Required: no
The snap store proxy ID.
Example usage:
spec:
snapstoreProxyID: "my-proxy-id"
httpsProxy
¶
Type: string
Required: no
The HTTPS_PROXY
configuration.
Example usage:
spec:
httpsProxy: "https://my.proxy.domain:8080"
httpProxy
¶
Type: string
Required: no
The HTTP_PROXY
configuration.
Example usage:
spec:
httpProxy: "http://my.proxy.domain:8080"
noProxy
¶
Type: string
Required: no
The NO_PROXY
configuration.
Example usage:
spec:
noProxy: "localhost,127.0.0.1"
channel
¶
Type: string
Required: no
The channel to use for the snap install.
Example usage:
spec:
channel: "1.32-classic/candidate"
revision
¶
Type: string
Required: no
The revision to use for the snap install.
Example usage:
spec:
channel: "1234"
localPath
¶
Type: string
Required: no
The local path to use for the snap install.
Example usage:
spec:
localPath: "/path/to/custom/k8s.snap"
nodeName
¶
Type: string
Required: no
nodeName
is the name to use for the kubelet of this node. It is needed
for clouds where the cloud-provider has specific pre-requisites about the
node names. It is typically set in Jinja template form, e.g.
"{{ ds.meta_data.local_hostname }}"
.
Example usage:
spec:
nodeName: "{{ ds.meta_data.local_hostname }}"
Control plane provider (CACPCK)¶
The following configurations are only available for the control plane provider.
replicas
¶
Type: int32
Required: no
replicas
is the number of desired machines. Defaults to 1. When stacked
etcd is used only odd numbers are permitted, as per [etcd best practice].
Example usage:
spec:
replicas: 2
controlPlane
¶
Type: struct
Required: no
controlPlane
is configuration for control plane nodes.
Fields:
Name |
Type |
Description |
Default |
---|---|---|---|
|
|
A list of SANs to include in the server certificates. |
|
|
|
The cloud-provider configuration option to set. |
|
|
|
Taints to add to the control plane kubelet nodes. |
|
|
|
The type of datastore to use for the control plane. |
|
|
|
A reference to a secret containing the datastore servers. |
|
|
|
The port to use for k8s-dqlite. If unset, 2379 (etcd) will be used. |
|
|
|
The address (or CIDR) to use for MicroCluster. If unset, the default node interface is chosen. |
|
|
|
The port to use for MicroCluster. If unset, “:2380” (etcd peer) will be used. |
|
|
|
Extra arguments to add to kube-apiserver. |
|
Example usage:
spec:
controlPlane:
extraSANs:
- extra.san
cloudProvider: external
nodeTaints:
- myTaint
datastoreType: k8s-dqlite
datastoreServersSecretRef:
name: sfName
key: sfKey
k8sDqlitePort: 2379
microclusterAddress: my.address
microclusterPort: ":2380"
extraKubeAPIServerArgs:
argKey: argVal