|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +description: Basic installation of the platform |
| 4 | +--- |
| 5 | + |
| 6 | +# Installation |
| 7 | + |
| 8 | +Let's discover how to install a basic version of the Kadras Engineering Platform. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +* Kubernetes 1.24+ |
| 13 | +* Carvel [`kctrl`](https://carvel.dev/kapp-controller/docs/latest/install/#installing-kapp-controller-cli-kctrl) CLI. |
| 14 | +* Sigstore [`cosign`](https://docs.sigstore.dev/cosign/installation/) CLI. |
| 15 | +* Carvel [kapp-controller](https://carvel.dev/kapp-controller) deployed in your Kubernetes cluster. You can install it with Carvel [`kapp`](https://carvel.dev/kapp/docs/latest/install) (recommended choice) or `kubectl`. |
| 16 | + |
| 17 | + ```shell |
| 18 | + kapp deploy -a kapp-controller -y \ |
| 19 | + -f https://github.com/carvel-dev/kapp-controller/releases/latest/download/release.yml |
| 20 | + ``` |
| 21 | + |
| 22 | +## Add the Kadras Repository |
| 23 | + |
| 24 | +Add the Kadras repository to make all Kadras packages available to the cluster. |
| 25 | + |
| 26 | + ```shell |
| 27 | + kubectl create namespace kadras-packages |
| 28 | + kctrl package repository add -r kadras-packages \ |
| 29 | + --url ghcr.io/kadras-io/kadras-packages \ |
| 30 | + -n kadras-packages |
| 31 | + ``` |
| 32 | + |
| 33 | +You can check the full list of available packages as follows. |
| 34 | + |
| 35 | + ```shell |
| 36 | + kctrl package available list -n kadras-packages |
| 37 | + ``` |
| 38 | + |
| 39 | +## Create a Secret for the OCI Registry |
| 40 | + |
| 41 | +First, create a Secret with the credentials to access your container registry in read/write mode. It will be used by the platform to publish and consume OCI artifacts. |
| 42 | + |
| 43 | + ```shell |
| 44 | + export SUPPLY_CHAIN_REGISTRY_HOSTNAME=<hostname> |
| 45 | + export SUPPLY_CHAIN_REGISTRY_USERNAME=<username> |
| 46 | + export SUPPLY_CHAIN_REGISTRY_TOKEN=<token> |
| 47 | + ``` |
| 48 | + |
| 49 | +* `<hostname>` is the server hosting the OCI registry. For example, `ghcr.io`, `gcr.io`, `quay.io`, `index.docker.io`. |
| 50 | +* `<username>` is the username to access the OCI registry. Use `_json_key` if the hostname is `gcr.io`. |
| 51 | +* `<token>` is a token with read/write permissions to access the OCI registry. Use the contents of the service account key json if the hostname is `gcr.io`. |
| 52 | + |
| 53 | + ```shell |
| 54 | + kubectl create secret docker-registry supply-chain-registry-credentials \ |
| 55 | + --docker-server="${SUPPLY_CHAIN_REGISTRY_HOSTNAME}" \ |
| 56 | + --docker-username="${SUPPLY_CHAIN_REGISTRY_USERNAME}" \ |
| 57 | + --docker-password="${SUPPLY_CHAIN_REGISTRY_TOKEN}" \ |
| 58 | + --namespace=kadras-packages |
| 59 | + ``` |
| 60 | + |
| 61 | +## Configure the Platform |
| 62 | + |
| 63 | +The installation of the Kadras Engineering Platform can be configured via YAML. Create a `values.yml` file with any configuration you need for the platform. The following is a minimal configuration example. |
| 64 | + |
| 65 | +```yaml title="values.yml" |
| 66 | +platform: |
| 67 | + ingress: |
| 68 | + domain: <domain> |
| 69 | + |
| 70 | + oci_registry: |
| 71 | + server: <oci-server> |
| 72 | + repository: <oci-repository> |
| 73 | + |
| 74 | +workspace_provisioner: |
| 75 | + namespaces: |
| 76 | + - name: default |
| 77 | +``` |
| 78 | +
|
| 79 | +* `<domain>` is the base domain name the platform will use to configure the Ingress controller. It must be a valid DNS name. For example, `lab.thomasvitale.com`. |
| 80 | +* `<oci-server>` is the server of the OCI registry where the platform will publish and consume OCI images. It must be the same used in step 3 when creating a Secret with the OCI registry credentials. For example, `ghcr.io`, `gcr.io`, `quay.io`, `index.docker.io`. |
| 81 | +* `<oci-repository>` is the repository in the OCI registry where the platform will publish and consume OCI images. It must be the same used in step 3 when creating a Secret with the OCI registry credentials. For example, it might be your username or organization name depending on which OCI server you're using. |
| 82 | + |
| 83 | +## Install the Platform |
| 84 | + |
| 85 | +Reference the `values.yml` file you created in the previous step and install the Kadras Engineering Platform. |
| 86 | + |
| 87 | + ```shell |
| 88 | + kctrl package install -i engineering-platform \ |
| 89 | + -p engineering-platform.packages.kadras.io \ |
| 90 | + -v ${VERSION} \ |
| 91 | + -n kadras-packages \ |
| 92 | + --values-file values.yml |
| 93 | + ``` |
| 94 | + |
| 95 | +You can find the `${VERSION}` value by retrieving the list of package versions available in the Kadras package repository installed on your cluster. |
| 96 | + |
| 97 | + ```shell |
| 98 | + kctrl package available list -p engineering-platform.packages.kadras.io -n kadras-packages |
| 99 | + ``` |
| 100 | + |
| 101 | +## Verify the Installation |
| 102 | + |
| 103 | +Verify that all the platform components have been installed and properly reconciled. |
| 104 | + |
| 105 | + ```shell |
| 106 | + kctrl package installed list -n kadras-packages |
| 107 | + ``` |
0 commit comments