Deckhouse Kubernetes Platform on Deckhouse Virtualization Platform (DVP)
Before installation, ensure the following:
- Cloud provider quotas for cluster deployment.
- The
cloud-initpackage is installed on the VMs. After the VM starts, servicescloud-config.service,cloud-final.service,cloud-init.servicemust be running. - The virtual machine template contains only one disk.
To deploy Deckhouse Kubernetes Platform on DVP, perform the initial setup in the virtualization system. Create a user (ServiceAccount), assign permissions, and obtain a kubeconfig.
-
Create a user (ServiceAccount and token) by running:
d8 k create -f -<<EOF apiVersion: v1 kind: ServiceAccount metadata: name: sa-demo namespace: default --- apiVersion: v1 kind: Secret metadata: name: sa-demo-token namespace: default annotations: kubernetes.io/service-account.name: sa-demo type: kubernetes.io/service-account-token EOF -
Assign a role to the user by running:
d8 k create -f -<<EOF apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: sa-demo-rb namespace: default subjects: - kind: ServiceAccount name: sa-demo namespace: default roleRef: kind: ClusterRole name: d8:use:role:manager apiGroup: rbac.authorization.k8s.io EOF -
Enable kubeconfig issuance via API. Open the
user-authnmodule settings (create a ModuleConfig resource nameduser-authnif it does not exist):d8 k edit mc user-authn -
Add the following section to the
settingsblock and save:publishAPI: enabled: true -
Generate a kubeconfig to be used in the cluster initial configuration file in the next step:
cat <<EOF > kubeconfig apiVersion: v1 clusters: - cluster: server: https://<KUBE-APISERVER-URL> # Replace this with the actual API server address for the cluster. name: <CLUSTER-NAME> # Replace with the cluster name. contexts: - context: cluster: <CLUSTER-NAME> # Replace with the cluster name. user: sa-demo namespace: default name: sa-demo-context current-context: sa-demo-context kind: Config preferences: {} users: - name: sa-demo user: token: $(d8 k get secret sa-demo-token -n default -o json | jq -rc .data.token | base64 -d) EOFEncode the generated kubeconfig file using Base64 encoding (it appears in the initial configuration file as follows):
base64 kubeconfig | tr -d '\n'