Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tutorial): Add tutorials for Kubernetes Easy Deploy applications #3300

Merged
merged 18 commits into from
Jun 24, 2024
9 changes: 9 additions & 0 deletions containers/kubernetes/how-to/enable-easy-deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ You can also deploy off-the-shelf applications pre-configured for Scaleway produ
* Get the Load Balancer's external IP and use it in your web browser to access your application (WordPress in this case)
<Lightbox src="scaleway-kubernetes-wordpress.webp" alt="" />

<Message type="tip">
We provide dedicated tutorials for deployment of the most popular applications using Easy Deploy:
* [Deploy Argo CD on Scaleway Kubernetes clusters using Easy Deploy](/tutorials/easydeploy-argocd/)
* [Deploy Vault on Scaleway Kubernetes clusters using Easy Deploy](/tutorials/easydeploy-vault/)
* [Deploy Grafana on Scaleway Kubernetes clusters using Easy Deploy](/tutorials/easydeploy-grafana/)
* [Deploy GitLab Server on Scaleway Kubernetes clusters using Easy Deploy](/tutorials/easydeploy-gitlab-server/)
* [Deploy GitLab Runner on Scaleway Kubernetes clusters using Easy Deploy](/tutorials/easydeploy-gitlab-runner/)
</Message>

## How to edit an application

1. Click **Kubernetes** in the **Containers** section of the [Scaleway console](https://console.scaleway.com) side menu. The Kubernetes Kapsule overview displays.
Expand Down
79 changes: 79 additions & 0 deletions tutorials/easydeploy-argocd/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
meta:
title: Deploy Argo CD on Scaleway Kubernetes clusters using Easy Deploy
description: Deploy Argo CD on Scaleway Kubernetes clusters using Easy Deploy. This guide provides steps for Argo CD to pull application definitions from a Git repository.
content:
h1: Deploy Argo CD on Scaleway Kubernetes clusters using Easy Deploy
paragraph: Deploy Argo CD on Scaleway Kubernetes clusters using Easy Deploy. This guide provides steps for Argo CD to pull application definitions from a Git repository.
tags: Argo CD kubernetes easy deploy
categories:
- containers
dates:
validation: 2024-06-13
posted: 2024-06-13
---

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
It synchronizes application definitions from a Git repository, ensuring that the desired state of applications is maintained across clusters.
Designed for high scalability and automation, Argo CD supports multi-cluster deployments, automated rollbacks, and advanced RBAC policies.
This makes it ideal for managing complex Kubernetes environments with precision and reliability.


<Macro id="requirements" />
- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/)
- Created a Scaleway Kubernetes [Kapsule](/containers/kubernetes/how-to/create-cluster/) or [Kosmos](/containers/kubernetes/how-to/create-kosmos-cluster/) cluster

## Deploying the Argo CD application using Easy Deploy

<Message type="important">
When configuring your Kubernetes cluster, note that certain applications and services, such as Argo CD, may result in additional resources being provisioned.
For example, your YAML configuration might create Block Storage volumes or Load Balancers, which could incur extra costs.
</Message>


1. In the [Scaleway console](https://console.scaleway.com/), navigate to the **Kubernetes** section under **Containers**.
2. Click the name of the cluster where you wish to deploy Argo CD. The **Cluster Information** tab will display.
3. Click the **Easy Deploy** tab. The application dashboard displays.
4. Click **Deploy Application**. The application deployment wizard displays.
5. Choose **Application Library** to see the list of available applications.
6. Select the **Argo CD** application.
<Message type="tip">
If you cannot find Argo CD on the first page, use the search bar or navigate through the library.
</Message>
7. Optionally, customize the default configuration for Argo CD using [Helm Charts](/tutorials/kubernetes-package-management-helm/). If you do not need any customized configuration you can skip this step.
8. Enter a name (e.g. `argocd`) and a Kubernetes namespace for your application. If no name is entered, Argo CD will be installed in the default namespace of the cluster.
9. Click **Deploy Application** to deploy Argo CD on your Kubernetes cluster.

## Retrieving the Argo CD admin password

1. Access the [Kubernetes Dashboard](/containers/kubernetes/how-to/access-kubernetes-dashboard/) of your cluster and navigate to **Secrets** under the **Config and Storage** section.
2. Click `argocd-initial-admin-secret` to display the application metadata information.
3. Click the "eye" icon next to `password` to reveal the Argo CD admin password. Copy the password.

## Connecting to Argo CD

Argo CD uses a LoadBalancer to manage traffic. To check the deployment status, run:

```
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argocd-applicationset-controller ClusterIP 10.39.101.19 <none> 7000/TCP 5m40s
argocd-dex-server ClusterIP 10.36.208.223 <none> 5556/TCP,5557/TCP 5m40s
argocd-redis ClusterIP 10.34.58.107 <none> 6379/TCP 5m40s
argocd-repo-server ClusterIP 10.35.236.175 <none> 8081/TCP 5m40s
argocd-server LoadBalancer 10.39.250.191 195.154.xx.yyy 80:30372/TCP,443:32468/TCP 5m40s
kubernetes ClusterIP 10.32.0.1 <none> 443/TCP 55m
```

Once the external IP status changes from `<PENDING>` to the assigned external IP, your Argo CD application is up. Copy the IP address and paste it into a web browser. The Argo CD login screen will appear.

## Logging into Argo CD

1. Paste the external IP address of the LoadBalancer service into your web browser to open the Argo CD login screen.
2. Enter **admin** as the username and the password retrieved in the previous step to log in.

### Going further

For more information about Argo CD and setting up your metrics, refer to the [official Argo CD documentation](https://argo-cd.readthedocs.io/en/stable/)
131 changes: 131 additions & 0 deletions tutorials/easydeploy-gitlab-runner/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
meta:
title: Deploy GitLab Runner on Scaleway Kubernetes clusters using Easy Deploy
description: Learn how to deploy GitLab Runner on Scaleway Kubernetes clusters using the Easy Deploy feature.
content:
h1: Deploy GitLab Runner on Scaleway Kubernetes clusters using Easy Deploy
paragraph: Learn how to deploy GitLab Runner on Scaleway Kubernetes clusters using the Easy Deploy feature.
categories:
- containers
dates:
validation: 2024-06-20
posted: 2024-06-20
---

GitLab Runner is a powerful tool that executes CI/CD jobs in GitLab.
When hosted on Kubernetes, it leverages the scalability and resilience of container orchestration to efficiently manage and run your pipelines.
By deploying GitLab Runner on a Kubernetes cluster, you can dynamically scale the number of runners based on demand, ensure high availability, and seamlessly integrate with your existing Kubernetes infrastructure.
This setup enables you to optimize resource utilization, reduce overhead, and enhance the performance of your continuous integration and deployment processes.

<Macro id="requirements" />
- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/)
- Created a Scaleway Kubernetes [Kapsule](/containers/kubernetes/how-to/create-cluster/) or [Kosmos](/containers/kubernetes/how-to/create-kosmos-cluster/) cluster
- A GitLab repository

## Deploying the GitLab Runner application using Easy Deploy

1. In the [Scaleway console](https://console.scaleway.com/), navigate to the **Kubernetes** section under **Containers**.
2. Click the name of the cluster where you wish to deploy GitLab Runner. The **Cluster Information** tab will display.
3. Click the **Easy Deploy** tab. The application dashboard displays.
4. Click **Deploy Application**. The application deployment wizard displays.
5. Choose **Application Library** to see the list of available applications.
6. Select the **GitLab Runner** application.
<Message type="tip">
If you cannot find GitLab Runner on the first page, use the search bar or navigate through the library using the arrow buttons.
</Message>
7. Optionally, customize the default configuration for GitLab Runner using [Helm Charts](/tutorials/kubernetes-package-management-helm/). If you do not need any customized configuration you can skip this step.
8. Enter a name (e.g. `gitlab-runner`) and a Kubernetes namespace for your application. If no name is entered, GitLab Runner will be installed in the default namespace of the cluster.
9. Click **Deploy Application** to deploy GitLab Runner on your Kubernetes cluster.
10. Verify that the GitLab Runner is successfully installed and running:
```bash
kubectl get pods -n default # replace "default" with the name of the Kubernetes namespace in which you have installed your GitLab Runner.
```
You should see a pod with a name similar to `gitlab-runner-xxxxxx-xxxxx` in the `Running` state.

## Configuring a GitLab CI/CD pipeline to use your Kubernetes Runner
bene2k1 marked this conversation as resolved.
Show resolved Hide resolved

<Message type="tip">
If you do not have a GitLab repository yet, you can deploy a [GitLab server using Easy Deploy](/tutorials/gitlab-server/) on your Kubernetes cluster.
</Message>

### Register the GitLab Runner with GitLab

Before your GitLab Runner can start executing jobs from your GitLab repository, it needs to be registered with your GitLab server, as shown below:

1. Obtain the GitLab Runner Registration Token:
- Go to your GitLab project.
- Navigate to **Settings** > **CI/CD** > **Runners**.
- Under the **Specific Runners** section, you will see the registration token.

2. Register the GitLab Runner:
- Connect to your Kubernetes cluster where the GitLab Runner is deployed.
- Use the following command to start the registration process:
```bash
kubectl exec -it <gitlab-runner-pod-name> -- gitlab-runner register
```
- When prompted, enter the following details:
- **GitLab instance URL:** The URL of your GitLab server (e.g., `https://gitlab.com` or your self-hosted GitLab URL).
- **Registration Token:** The token you obtained in the previous step.
- **Description:** A description for this runner (e.g., `k8s-runner`).
- **Tags:** Tags for the runner (e.g., `k8s-runner`). These tags should match the tags specified in your `.gitlab-ci.yml` file.
- **Executor:** Select `kubernetes` as the executor.

### Verify Runner registration

After registering the runner, verify that it is correctly registered and active:

1. In your GitLab project, navigate to **Settings** > **CI/CD** > **Runners**.
2. You should see your newly registered runner listed under the **Specific Runners** section.

### Configure the GitLab CI/CD pipeline

1. Create/Edit the `.gitlab-ci.yml` file:
- Ensure your `.gitlab-ci.yml` file includes jobs with tags that match your runner’s tags. Refer to the configuration example below to picture what your file should look like:
```yaml
stages:
- build
- test

build:
stage: build
script:
- echo "Building the project..."
- # Add your build steps here
tags:
- k8s-runner

test:
stage: test
script:
- echo "Running tests..."
- # Add your test steps here
tags:
- k8s-runner
```

2. Push the configuration to GitLab:
- Push your `.gitlab-ci.yml` file to your GitLab repository:
```bash
git add .gitlab-ci.yml
git commit -m "Add CI/CD pipeline configuration"
git push origin main
```

### Monitor the pipeline

Navigate to **CI/CD** > **Pipelines** in your GitLab project to view the status of your pipeline.

<Message type="tip">
If the pipeline fails, you can check the logs of the GitLab Runner pod for more information:
```bash
kubectl logs -n default <gitlab-runner-pod-name>
```
</Message>

# Conclusion

You have successfully set up a GitLab Runner hosted on Kubernetes and configured your GitLab CI/CD pipeline to use it. This setup allows you to leverage the scalability and flexibility of Kubernetes for your CI/CD workflows.

For more detailed information on configuring your GitLab Runner, refer to the [official GitLab documentation](https://docs.gitlab.com/runner/install/kubernetes.html#configuring-gitlab-runner-using-the-helm-chart).
78 changes: 78 additions & 0 deletions tutorials/easydeploy-gitlab-server/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
meta:
title: Deploy GitLab Server on Scaleway Kubernetes clusters using Easy Deploy
description: Deploy GitLab server on Scaleway Kubernetes clusters with Easy Deploy. This guide provides steps for deployment and configurations for optimal GitOps practices.
content:
h1: Deploy GitLab Server on Scaleway Kubernetes clusters using Easy Deploy
paragraph: Deploy GitLab server on Scaleway Kubernetes clusters with Easy Deploy. This guide provides steps for deployment and configurations for optimal GitOps practices
tags: GitLab server kubernetes easy deploy
categories:
- containers
dates:
validation: 2024-06-20
posted: 2024-06-20
---

This tutorial provides a guide to deploy a GitLab server on Scaleway Kubernetes clusters using the Easy Deploy feature.
It outlines the prerequisites, step-by-step deployment instructions, and post-deployment configurations necessary for optimal continuous delivery and GitOps practices.

<Macro id="requirements" />
- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/)
- Created a Scaleway Kubernetes [Kapsule](/containers/kubernetes/how-to/create-cluster/) or [Kosmos](/containers/kubernetes/how-to/create-kosmos-cluster/) cluster
- A domain name and access to its DNS zone

## Deploying the GitLab Server application using Easy Deploy

1. In the [Scaleway console](https://console.scaleway.com/), navigate to the **Kubernetes** section under **Containers**.
2. Select the cluster where you want to deploy the GitLab server. The **Cluster Information** tab will display.
3. Click the **Easy Deploy** tab to open the application dashboard.
4. Click **Deploy Application** to launch the deployment wizard.
5. Select **Application Library** to view the list of available applications.
6. Choose the **GitLab server** application.
<Message type="tip">
If you cannot find the GitLab server application on the first page, use the search bar or navigate through the library.
</Message>
7. Customize the default configuration for GitLab server using [Helm Charts](/tutorials/kubernetes-package-management-helm/). The default configuration looks as follows:
```yaml
certmanager-issuer:
email: [email protected]
global:
hosts:
domain: gitlab.example.com
```
Replace the following parameters:
- `email`: Your email address.
- `domain`: Your domain name.
<Message type="note">
The GitLab Server application is configured to use a `gitlab` subdomain. If you want your application running at `gitlab.example.com`, enter `example.com`.
</Message>
8. Enter a name (e.g., `gitlab-server`) and a Kubernetes namespace for your application. If no name is entered, GitLab server will be installed in the default namespace.
9. Click **Deploy Application** to deploy the GitLab server on your Kubernetes cluster.

## Retrieving the GitLab Server root password

1. Access the [Kubernetes Dashboard](/containers/kubernetes/how-to/access-kubernetes-dashboard/) of your cluster and navigate to **Secrets** under the **Config and Storage** section.
2. Click `gitlab-server-gitlab-initial-root-password` to display the application metadata.
3. Click the eye icon next to `password` to reveal and copy the GitLab server root password.

## Connecting to GitLab Server

GitLab server uses a Load Balancer to manage traffic. To check the deployment status, run:

```bash
$ kubectl get svc
```

Look for the `gitlab-server-nginx-ingress-controller` service. Once the `EXTERNAL-IP` status changes from `<PENDING>` to an assigned IP, your GitLab server application is up.
Configure an A-record for the `gitlab` subdomain in your DNS zone, pointing to the Load Balancer IP.
bene2k1 marked this conversation as resolved.
Show resolved Hide resolved

## Logging into GitLab Server

1. Open your GitLab server subdomain in a web browser.
2. Enter **root** as the username and the password retrieved earlier to log in.

## Additional resources

For more detailed information on GitLab server configuration and metrics setup, refer to the [official GitLab server documentation](https://docs.gitlab.com/).
Loading