This repository contains ansible playbook settings for infrastructure setup (ansible/
directory)
together with Kubernetes manifest files for different applications managed by ArgoCD (applications/
directory).
Before beginning with application management, infrastructure setup is required. For this, you should use the playbook ansible/cloud-infrastructure-setup.yaml. Given an access to virtual machines with python3.8+ installed, it is capable of:
- Disk setup in case if each virtual machine has a separate disk attached as a device;
- Installation of RKE2-managed Kubernetes cluster with a single server and workers;
- Installation of Helm tool binary;
- Installation of ArgoCD: both Kubernetes manifests and command-line binary.
All these steps can be customized via either ansible/vars.defaults or ansible/vars.custom
file.
The example infra has 3 VMs with python3.9
installed.
After establishing ssh-based connection to the machines, you can execute the playbook:
ansible-playbook -i hosts -D cloud-infrastructure-setup.yaml
After successful run, the infra is ready for further steps.
You should run all the command described below on the RKE2 server, where ArgoCD binary installed, only.
The following lines ensure user login to ArgoCD server via argocd
binary.
They should run prior to every application-related action.
ARGOCD_SERVER_IP=$(kubectl get service argocd-server -n argocd -o jsonpath={.spec.clusterIP})
ARGOCD_ADMIN_PASSWORD=$(argocd admin initial-password -n argocd | head -n1)
argocd login $ARGOCD_SERVER_IP:80 --username admin --password $ARGOCD_ADMIN_PASSWORD --name default
You can validate authentication and access:
argocd account get-user-info
argocd app list
You can use this app manifest and this custom values file for Longhorn installation.
This script creates a new Kubernetes namespace, where application is created synched:
kubectl create namespace longhorn-system
argocd app create -f applications/longhorn/application.yaml
argocd app sync argocd/longhorn
You can use this app manifest and this custom values file for PostgreSQL operator installation.
This script creates a new Kubernetes namespace, where application is created synched:
kubectl create namespace postgres-operator-system
argocd app create -f applications/postgresql-operator/application.yaml
argocd app sync argocd/postgres-operator
Waldur requires PostgreSQL database as a persistent storage and RabbitMQ as a message queue to be up and running.
Firstly, you need to create a namespace for Waldur:
kubectl create namespace waldur
Secondly, create and sync PostgreSQL application managed by the operator installed before. You can use this manifest for ArgoCD app and this manifest for modification of the DB settings.
argocd app create -f applications/waldur-postgresql/application.yaml
argocd app sync argocd/waldur-postgresql
Finally, you can deploy Waldur using this app manifest and these values. NB: RabbitMQ is included in the deployment.
argocd app create -f applications/waldur/application.yaml
argocd app sync argocd/waldur