Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ digitalai/
digitalai*yaml
*.lic
ziprepo

*.kubeconfig
54 changes: 28 additions & 26 deletions part-3/lab-6-prepare-for-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,9 @@ To run container-based integration plugins on a Kubernetes cluster, you will nee

* Access to a Kubernetes cluster. This could be Docker Desktop or minikube; or a cloud-based environment like AWS EKS, Azure AKS, Google Cloud or OpenShift.
* [kubectl](https://kubernetes.io/docs/tasks/tools/)
* [Helm](https://helm.sh/docs/intro/install/)
* [k3d](https://k3d.io/)
* [k9s](https://k9scli.io/topics/install/) - _(Optional)_ Kubernetes CLI to "Manage Your Clusters In Style". This is a very handy utility.

Depending on the flavor of Kubernetes you are using, install the following tools provided by the vendor.

### Azure AKS

- [Azure Cli - az](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) - if you are working with Azure during workshop

### Minikube

- [minikube](https://minikube.sigs.k8s.io/docs/start/) - if you plan to use Minikube during workshop (use the latest version), we are testing only on minikube with [virtualbox driver](https://minikube.sigs.k8s.io/docs/drivers/virtualbox/)
- [virtualbox driver](https://minikube.sigs.k8s.io/docs/drivers/virtualbox/)

XXX Openshift or AWS?


## Configure your `hosts` file

The Remote Runner needs to be able to find the other components in the system: the Release server and the registry we just installed. The easiest way to do so is to add it to your local machine's `hosts` file.
Expand All @@ -61,7 +47,7 @@ Add the following entry to `C:\Windows\System32\drivers\etc\hosts` (Run as admin

You will need to use some code examples that are in the workshop repository.

Check out the repository and navigate to `part-5`
Check out the repository and navigate to `part-3`

**Http:**

Expand All @@ -73,7 +59,7 @@ Check out the repository and navigate to `part-5`

Then:

cd release-integration-sdk-workshop/part-5
cd release-integration-sdk-workshop/part-3

### Run Digital.ai Release

Expand All @@ -90,27 +76,43 @@ Let's first checkout that it works.

For the workshop, we will use `xlw`, the "xl wrapper", a wrapper script that takes care of downloading and running the correct version of `xl`.

In the `part-5` directory, issue the following command:
In the `part-3` directory, issue the following command:

./xlw version
docker run -it xebialabs/xl-client:23.1.0-rc.2 version

XXX Windows

The result should be something like:

```
Downloading xl binary to /Users/hsiemelink/.xebialabs/wrapper/23.1.0-beta.10/xl
CLI version: 23.1.0-beta.10
Git version: v23.1.0-331.113-1-ga6b13b4
...
7f6088910750: Pull complete
427b377c30f5: Pull complete
Digest: sha256:756326e2c593ef5030801e0fbb73dd453f03668c570b1ff30978b689a96a172e
Status: Downloaded newer image for xebialabs/xl-client:23.1.0-rc.2
CLI version: 23.1.0-rc.2
Git version: v23.1.0-rc.1-1-g267bc7d
API version XL Deploy: xl-deploy/v1
API version XL Release: xl-release/v1
Git commit: a6b13b42ff31acc3c9a40741e09dabee08cac576
Build date: 2023-04-03T09:26:14.345Z
Git commit: 267bc7dcf19d34fc4cb4c40f988178596f75b208
Build date: 2023-04-24T12:50:28.546Z
GO version: go1.19
OS/Arch: darwin/amd64
OS/Arch: linux/amd64

```

### Install k3d

1. Install the k3d according to [k3d install](https://k3d.io/v5.4.9/#installation)
2. Create k3d cluster:
In the `part-3` directory, issue the following command:


k3d cluster create xlrcluster --volume $PWD/xlrcluster-pv:/kube \
--registry-create xlr-registry:5051 \
--k3s-arg "--tls-san=host.docker.internal@server:0"

You are now set to start the installation procedure of the Remote Runner!

---
[Next](lab-7-install-remote-runner.md)
[Next](lab-7-install-remote-runner.md)
88 changes: 60 additions & 28 deletions part-3/lab-7-install-remote-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ We need to configure Release with a _service user_ for the Remote Runner and giv

Use the following command to create an account for the Remote Runner. Feel free to use a different password.

./xlw apply -f remote-runnner-user.yaml --values password=Remote123
In case of Docker Desktop or K3D:

docker run -it \
-v ${PWD}:/opt/xebialabs/xl-client/config \
xebialabs/xl-client:23.1.0-rc.2 \
apply -f /opt/xebialabs/xl-client/config/remote-runnner-user.yaml --values password=Remote123 --xl-release-url=http://host.docker.internal:5516/

In case of K3D:

docker run -it \
-v ${PWD}:/opt/xebialabs/xl-client/config \
--network dev-environment_default \
xebialabs/xl-client:23.1.0-rc.2 \
apply -f /opt/xebialabs/xl-client/config/remote-runnner-user.yaml --values password=Remote123 --xl-release-url=http://dev-environment-digitalai-release-1:5516/

The Remote Runner needs a token to register itself with the Release server. In order to obtain a token, do the following

Expand All @@ -23,68 +36,87 @@ Install the Remote Runner into your local Kubernetes environment with the `xl ku

💡 **Note:** You can also use `xl kube install` to install Release or Deploy itself. XXX Link to documentation and workshop.

In case of Docker Desktop (check the name of the context with `docker context ls`):

docker context export default --kubeconfig

In case of k3d (replace the `cluster_name` with your k3d cluster - `k3d cluster list`):

k3d kubeconfig get cluster_name | sed 's/0.0.0.0/host.docker.internal/g' > default.kubeconfig

We've marked some questions with a warning sign where you need to pay extra attention.

```
$ ./xlw kube install

? Following kubectl context will be used during execution: `docker-desktop`?
$ docker run -it \
-e KUBECONFIG=/opt/xebialabs/.kube/config \
-v ${PWD}/default.kubeconfig:/opt/xebialabs/.kube/config \
-v ${PWD}:/opt/xebialabs/xl-client/config \
xebialabs/xl-client:23.1.0-rc.2 \
kube install

? Following kubectl context will be used during execution: `k3d-xlrcluster`?
» Yes
? Select the Kubernetes setup where the Digital.ai Devops Platform will be installed, updated or cleaned:
? Select the Kubernetes setup where the Digital.ai Devops Platform will be installed, updated or cleaned:
»⚠️ PlainK8s [Plain multi-node K8s cluster]
? Do you want to use an custom Kubernetes namespace (current default is 'digitalai'):
? Do you want to use an custom Kubernetes namespace (current default is 'digitalai'):
» No
? Product server you want to perform install for:
? Product server you want to perform install for:
»⚠️ dai-release-runner [Remote Runner for Digital.ai Release]
? Select type of image registry:
? Select type of image registry:
» default
? Enter the repository name (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):
? Enter the repository name (eg: <repositoryName> from <repositoryName>/<imageName>:<tagName>):
» xebialabs
? Enter the remote runner image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):
? Enter the remote runner image name (eg: <imageName> from <repositoryName>/<imageName>:<tagName>):
» xlr-remote-runner
? Enter the image tag (eg: <tagName> from <repositoryName>/<imageName>:<tagName>):
» 0.1.32
» 0.1.33
? Enter the Remote Runner Helm Chart release name:
» remote-runner
? Use default version of the Remote Runner helm chart.
» Yes
? Enter the Release URL that will be used by remote runner:
»⚠️ http://http://digitalai.release.local:5516/
? Enter the Release Token that will be used by remote runner:
»⚠️ rpa_... (Paste token here)
? Enter the Release URL that will be used by remote runner:
»⚠️ http://host.k3d.internal:5516/
? Enter the Release Token that will be used by remote runner:
»⚠️ rpa_...
? Enter the remote runner replica count:
» 1
? Provide storage class for the remote runner: hostpath
? Provide storage class for the remote runner:
» local-path
? Provide storage class base host path (input '-' to skip the usage of base host path):
»⚠️ - <---- Docker Desktop
»⚠️ /kube <---- K3D
-------------------------------- ----------------------------------------------------
| LABEL | VALUE |
-------------------------------- ----------------------------------------------------
| CleanBefore | false |
| CreateNamespace | true |
| ExternalOidcConf | external: false |
| GenerationDateTime | 20230308-152423 |
| GenerationDateTime | 20230424-181416 |
| ImageNameRemoteRunner | xlr-remote-runner |
| ImageRegistryType | default |
| ImageTagRemoteRunner | 0.1.32 |
| IngressType | none |
| ImageTagRemoteRunner | 0.1.33 |
| IngressType | nginx |
| IsCustomImageRegistry | false |
| K8sSetup | PlainK8s |
| OidcConfigType | no-oidc |
| OsType | darwin |
| OsType | linux |
| ProcessType | install |
| RemoteRunnerHelmChartUrl | /Users/hsiemelink/Code/xlr-remote-runner/helm/re.. |
| RemoteRunnerReleaseUrl | host.docker.internal |
| RemoteRunnerStorageClass | hostpath |
| RemoteRunnerToken | rpa_9254744b183882ae604e14ac5644c05f3baa3b8c |
| RepositoryName | xebialabs |
| RemoteRunnerBaseHostPath | /kube |
| RemoteRunnerCount | 1 |
| RemoteRunnerReleaseName | remote-runner |
| RemoteRunnerReleaseUrl | http://host.k3d.internal:5516/ |
| RemoteRunnerStorageClass | local-path |
| RemoteRunnerToken | rpa_... |
| RemoteRunnerUseDefaultLocation | true |
| ServerType | dai-release-runner |
| ShortServerName | other |
| UseCustomNamespace | false |
-------------------------------- ----------------------------------------------------
? Do you want to proceed to the deployment with these values? Yes
For current process files will be generated in the: digitalai/dai-remote-runner/digitalai/20230308-152423/kubernetes
Generated answers file successfully: digitalai/generated_answers_dai-release-runner_digitalai_install-20230308-152423.yaml
For current process files will be generated in the: digitalai/dai-remote-runner/digitalai/20230424-181416/kubernetes
Generated answers file successfully: digitalai/generated_answers_dai-release-runner_digitalai_install-20230424-181416.yaml
Starting install processing.
Installing helm chart remote-runner from /Users/hsiemelink/Code/release-integration-template-python/doc/digitalai/dai-remote-runner/digitalai/20230308-152423/kubernetes/helm-chart
Installing helm chart remote-runner from /opt/xebialabs/xl-client/digitalai/dai-remote-runner/digitalai/20230424-181416/kubernetes/remote-runner-0.7.33.tgz
Installed helm chart remote-runner to namespace digitalai
```

Expand Down