diff --git a/docs/usage/airgap.md b/docs/usage/airgap.md index 2dca0ae..e83c7da 100644 --- a/docs/usage/airgap.md +++ b/docs/usage/airgap.md @@ -1,5 +1,9 @@ # Air-gapped Installation Guide +> WARNING: +> Currently only vSphere infrastructure provider supports full air-gapped +> installation. + ## Prerequisites In order to install HMC in an air-gapped environment, you need will need the @@ -85,20 +89,116 @@ following: ```bash helm install hmc oci:///hmc \ - --version \ + --version \ -n hmc-system \ --create-namespace \ - --set controller.defaultRegistryURL="oci://" + --set controller.defaultRegistryURL=oci:// ``` -5. Within the `spec:` for your desired `ClusterDeployment` object, specify the - custom image registry and chart repository to be used (the registry and chart - repository where the `extensions` bundle and charts were pushed). +5. Edit the `Management` object to add the airgap parameters. + + > NOTE: + > Use `insecureRegistry` parameter only in case if you have plain HTTP + > registry. + + The resulting yaml may look like this: + + ```yaml + apiVersion: hmc.mirantis.com/v1alpha1 + kind: Management + metadata: + name: hmc + spec: + core: + capi: + config: + airgap: true + hmc: + config: + controller: + defaultRegistryURL: oci:// + insecureRegistry: true + providers: + - config: + airgap: true + name: k0smotron + - config: + airgap: true + name: cluster-api-provider-vsphere + - name: projectsveltos + release: + ``` - ```yaml - spec: - config: - extensions: - imageRepository: ${IMAGE_REPOSITORY} - chartRepository: ${CHART_REPOSITORY} - ``` +6. Place k0s binary and airgap bundle at internal server, so they could be + available over HTTP. This is required for the airgap provisioning process, + since k0s components must be downloaded at each node upon creation. + Alternatively you can create the following example deployment using the k0s + image provided in the bundle. + + > NOTE: + > k0s image version is the same that the default defined in the vSphere + > template. + + + ```yaml + --- + apiVersion: apps/v1 + kind: Deployment + metadata: + name: k0s-ag-image + labels: + app: k0s-ag-image + spec: + replicas: 1 + selector: + matchLabels: + app: k0s-ag-image + template: + metadata: + labels: + app: k0s-ag-image + spec: + containers: + - name: k0s-ag-image + image: k0s-ag-image:v1.31.1-k0s.1 + ports: + - containerPort: 80 + --- + apiVersion: v1 + kind: Service + metadata: + name: k0s-ag-image + spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: k0s-ag-image + type: NodePort + ``` + +## Creation of the ClusterDeployment + +In order to successfully deploy a cluster several configuration options must be +defined in the `.spec.config` of the `ClusterDeployment. + +You must specify the custom image registry and chart repository to be used (the +registry and chart repository where the `extensions` bundle and charts were +pushed). + +Apart from that you must provide endpoint where k0s binary and airgap bundle +could be downloaded (step `6` of the [installation procedure](#installation)) + +```yaml +spec: + config: + airgap: true + k0s: + downloadURL: "http:///k0s" + bundleURL: "http:///k0s-airgap-bundle" + extensions: + imageRepository: ${IMAGE_REPOSITORY} + chartRepository: ${CHART_REPOSITORY} +```