This repository contains the deployments and descriptions for the DOME-Marketplace. The development instance of the DOME-Marketplace runs on a managed kubernetes, provided by Ionos.
A description of the deployed architecture and a description of the main flows inside the system can be found here.
The GitOps approach aims for a maximum of automation and will allow to reproduce the full setup. For more information about GitOps, see: - RedHat Pros and Cons - https://www.redhat.com/architect/gitops-implementation-patterns - ArgoCD - https://argo-cd.readthedocs.io/en/stable/ - FluxCD - https://fluxcd.io/
β οΈ All documentation and tools use Linux and are tested exclusively on that platform (specifically Ubuntu). If you are using a different system, please ensure you find suitable replacements that meet your requirements.
In order to setup the DOME-Marketplace, its recommended to install the following tools before starting
- ionosctl-cli to interact with the Ionos-APIs
- jq as a json-processor to ease the work with the client outputs
- kubectl for debugging and inspecting the resources in the cluster
- kubeseal for sealing secrets using asymmetric cryptography
π‘ Even thought the cluster creation was done on Ionos, the following steps apply to all Kubernetes installations (tested version is 1.26.7). Its not required to use Ionos for that.
In order to provide GitOps capabilities, we use ArgoCD. To setup the tool, we use ArgoCD helm chart.
Before starting the integration process, the team has to configure kubectl in order to access the remote cluster locally following the steps described below.
- Request the cluster administrator to create a service account, providing the name of your organization and the namespace within which your application will be deployed. You will be provided with a configuration file to access the cluster;
- modify the KUBECONFIG environment variable by adding the path to the configuration file;
- verify that the new context has been added by executing the following command
kubectl config get-contexts- switch the context by executing the following command:
kubectl config use-context <name of the context>
After these steps, the team is able to run kubectl commands on the remote cluster.
The team must ensure that the username of the new context is unique across all contexts. If the username is already in use, the developer must update it in the configuration file.
The associated service account operates with limited permissions, allowing view access to all namespace resources but write access exclusively to secrets.
Team members begin by forking the main GitOps repository and creating a new branch for their specific integration work. This facilitates isolated development and changes.
The GitOps repository has the following structure:
.github/
βββ CODEOWNERS
βββ workflows/
applications_sbx/
βββ app_1/
βββ app_1.yaml
βββ app_2/
βββ app_2.yaml
. . .
applications_dev/
βββ app_1/
βββ app_1.yaml
βββ app_2/
βββ app_2.yaml
. . .
applications_dev2/
βββ app_1/
βββ app_1.yaml
βββ app_2/
βββ app_2.yaml
. . .
applications_prd/
βββ app_1/
βββ app_1.yaml
βββ app_2/
βββ app_2.yaml
. . .
doc/
βββ application_owners/
βββ devops/
βββ external-dns-ionos-webhook/
βββ img/
βββ ARCHITECTURE.md
. . .
ionos_sbx/
βββ app_1/
βββ Chart.yaml
βββ values.yaml
. . .
ionos_dev/
βββ app_1/
βββ Chart.yaml
βββ values.yaml
. . .
ionos_dev2/
βββ app_1/
βββ Chart.yaml
βββ values.yaml
. . .
ionos_prd/
βββ app_1/
βββ Chart.yaml
βββ values.yaml
For each environment, two main directories are defined:
applications_<env>: it will host the environment-specific ArgoCD applications;ionos_<env>: it will host application's manifest files;
This section explains the application owners how to deploy an application into the DOME repository. The development workflow relies on two distinct but integrated enviroments: the version control system on GitHub for code management and the ticketing platform for task tracking. Although the ticketing system operates outside the direct scope of the automated DevOps pipeline, it plays a critical role in monitoring development activities. Therefore, developers are required to adhere to a dual-step process: opening a tracking ticket to define the scope of work, followed by the creation of a Pull Request on GitHub. This practice ensures that all modifications are properly cataloged and auditable. The operations every application owner must follow are described below.
-
Ownership & Traceability through the CODEOWNERS file To ensure clear accountability from the start, make sure that your GitHub username is added to the
CODEOWNERSfile, linked here. -
Integration Pipeline The team intending to integrate its component on DOME needs to adhere to a structured set of steps, which vary depending on wheter it is an initial release or a subsequent update.
If the application if being deployed for the first time, the steps are:
- fork the repository and create a new branch;
- add component manifest file;
- add ArgoCD application;
- create a Pull Request and a related ticket on the ticketing system.
If the application has alreeady been deployed, the steps are:
- fork the repository and create a new branch;
- update component manifest file;
- create a Pull Request and a related ticket on the ticketing system
Further informations about the deploy procedure are explained in the INTEGRATION file, linked here.
- Create a ticket on the Ticketing System In order to approve and merge your PR you have to create a new ticket on the DOME Ticketing System, which can be found here.
The steps to create a new ticket related to your PR are the followings.
- The category "13 β DevOps Deployment" must be selected;
- It is mandatory to classify the request using the specific "Problem Typology" corresponding to the affected environment: 01 β PR SBX: This code refers to issues occurring in the Prototyping environment; 02 β PR DEV: This code refers to issues occurring in the Pre-Production environment; 03 β PR PROD: This code refers to issues occurring in the Production environment; 04 β New deployment environment request: This category is used to request the setup of a new environment.
- Insert the name of both the environment and the component you are requesting the update;
- Put the link of your PR on the ticket.
To properly seperate concerns, the first application to be deployed will be the namespaces. It will create all namespaces defined in the ionos/namespaces folder.
Apply the application via:
kubectl apply -f applications/namespaces.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdUsing GitOps, means every deployed resource is represented in a git-repository. While this is not a problem for most resources, secrets need to be handled differently. We use the bitnami/sealed-secrets project for that. It uses asymmetric cryptography for creating secrets and only decrypt them inside the cluster. The sealed-secrets controller will be the first application deployed using ArgoCD. Since we want to use the Helm-Charts and keep the values inside our git-repository, we get the problem of ArgoCD only supporting values-files inside the same repository as the chart(as of now, there is an open PR to add that functionality -> PR#8322 ). In order to workaround that shortcomming, we are using "wrapper charts". A wrapper-chart does consist of a Chart.yaml with a dependency to the actual chart. Besides that, we have a values.yaml with our specific overrides. See the sealed-secrets folder as an example.
Apply the application via:
kubectl apply -f applications/sealed-secrets.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdOnce its deployed, secrets can be "sealed" via:
kubeseal -f mysecret.yaml -w mysealedsecret.yaml --controller-namespace sealed-secrets --controller-name sealed-secretsIn order to access applications inside the cluster, an Ingress-Controller is required. We use the NGINX-Ingress-Controller here.
The configuration expects a nodepool labeld with
ingressin order to safe IP addresses. If you followed cluster-creation such pool already exists.
Apply the application via:
kubectl apply -f applications/ingress.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdIn order to automatically create DNS entries for Ingress-Resources, External-DNS is used.
π‘ The
dome-marketplace.org|io|eu|comdomains are currently using nameservers provided by AWS Route53. If you manage the domains somewhere else, follow the recommendations in the External-DNS documentation.
- External-DNS watches the ingress objects and creates A-Records for them. To do so, it needs the ability to access the AWS APIs.
- Create the IAM Policy accoring to the documentation
- Create a user in AWS IAM and assign the policy.
- Create an access key and store it in a file of format:
[default]
aws_secret_access_key = THE_KEY
aws_access_key_id = THE_KEY_ID4. Base64 encode the file and put it into a secret of the following format:
apiVersion: v1
kind: Secret
metadata:
name: aws-access-key
namespace: infra
data:
credentials: W2RlZmF1bHRdCmF3c19zZWNyZXRfYWNjZXNzX2tleSA9IFRIRV9LRVkKYXdzX2FjY2Vzc19rZXlfaWQgPSBUSEVfS0VZX0lE5. Seal the secret and commit the sealed secret. :warning: Never put the plain secret into git.
- Apply the application:
kubectl apply -f applications/external-dns.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdIn addition to the dns-entries, we also need valid certificates for the ingress. The certificates will be provided by Lets encrypt. To automate creation and update of the certificates, Cert-Manager is used.
- In order to follow the ACME protocol, Cert-Manager also needs the ability to create proper DNS entries. Therefor we have to provide the AWS account used by External-DNS, too.
- Put key and key-id into the following template:
apiVersion: v1
kind: Secret
metadata:
name: aws-access-key
namespace: cert-manager
stringData:
key: "THE_KEY"
keyId: "THE_KEY_ID"2. Seal the secret and commit the sealed secret. :warning: Never put the plain secret into git.
- Update the issuer with information about the hosted zone managing your domain and commit it.
- Apply the application:
kubectl apply -f applications/cert-manager.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdArgoCD provides a nice GUI and a command-line tool to support the deployments. In order for them to work properly, an ingress and auth-mechanism need to be configured.
Since ArgoCD is already running, we also use it to extend it self, by just providing an ingress-resource pointing towards its server. That way, we will get a proper URL automatically throught the previously configured External-DNS and Cert-Manager.
To seamlessly use ArgoCD, we use Githubs Oauth to manage users for ArgoCd together with those accessing the repo.
- Register ArgoCd in Github, following the documentation
- Put the secret into:
apiVersion: v1
kind: Secret
metadata:
labels:
app.kubernetes.io/part-of: argocd
name: github-secret
namespace: argocd
stringData:
clientSecret: THE_CLIENT_SECRET- Seal and commit it.
- Configure the organizations to be allowed in the configmap
- Configure user-roles in the rbac-configmap
- Apply the application
kubectl apply -f applications/argocd.yaml -n argocd
# wait for it to be SYNCED and Healthy
watch kubectl get applications -n argocdLogin to our ArgoCD.