- Shell 66.7%
- Nix 33.3%
|
Wilmhit
01746ab762
feat: add hedgedoc ( #46 )
Closes #37 Reviewed-on: #46 Reviewed-by: Jacek Pruciak <juniorjpdj@noreply.codeberg.org> |
||
|---|---|---|
| appprojs | chore: add nix shell | |
| apps | feat: add hedgedoc ( #46 ) | |
| charts | feat: add hedgedoc ( #46 ) | |
| manifests | fix(manifests/redirector): add cert-manager annotation for ingress | |
| .gitignore | feat: add authentik | |
| README.md | feat: apps cleanup | |
| renovate.json | feat: add authentik | |
| shell.nix | chore: add nix shell | |
Knyfyrtel Hackerspace Poznań kubernetes-based infrastructure repository
Directories
apps/
ArgoCD Application manifests, every application visible in ArgoCD should be here.
Manifests are organized in subdirectories by project name.
Contains backup.sh script for loading latest manifests from live ArgoCD - may be useful when you prefer to click application in GUI first.
Be aware to not commit any secrets in manifests.
appprojs/
ArgoCD Application Project manifests.
charts/
Helm Charts, including umbrella charts for applications that needs some secret values encryption.
More about encryption below.
manifests/
Plain Kubernetes manifests to be deployed by apps when Helm Chart is overkill.
Encryption of Helm Chart values
If your application needs some secret values, those should be encrypted.
This is done by using helm-secrets plugin with sops integration built-in to ArgoCD image.
SOPS is a tool that can encrypt YAML and also other text files.
We integrate helm-secrets with sops and use Hashicorp Vault backend for sops to manage encryption keys within OpenBAO.
If you are not in Infra Team and you want to install something, make sure you add age or gpg key when encrypting file as you ain't have access to decrypt the file later.
- For encrypted values it's neccessary to create umbrella chart for your application.
Umbrella chart is a simple helm chart with just a dependency to your application chart.
Here you can create values.yaml file for your non-sensitive values and secrets.yaml file for sensitive ones. - The next step is to encrypt the secrets.yaml file with sops.
You first need to login to OpenBAO in CLI for sops to have access to the key.
vault login -address https://vault.knyfyrtel.pl -method=oidc
Then encrypt the file.
Example encryption command:
sops --encrypt -i --hc-vault-transit https://vault.knyfyrtel.pl/v1/sops/keys/charts --age age1emh3py760fm3sxljcasnhunftplkec8pannqjah0rsxcmdtvhfas534lcd secrets.yaml
Make sure to replace an age key with your own.
That will allow ArgoCD and Infra Team to decrypt the file using OpenBAO and you should be able to decrypt using your own age key. - The last step is to create an ArgoCD application for your umbrella chart.
You need to specifyvalues.yamlandsecrets://secrets.yamlas values files.secrets://prefix is required for ArgoCD to know that you want to use an encrypted file. - To later edit the secrets.yaml file you can use
sops edit secrets.yamlcommand.
Easy way?
Just copy Umbrella Chart directory from charts/authentik to charts/<your-app-name> and rename it to your application name.
Replace all the values, dependencies, wipe the secrets.yaml file, fill it with your own secrets and encrypt it with sops.
Copy application from apps/default/authentik.yaml to apps/default/<your-app-name>.yaml, change the name, destination namespace and directory (path) and you're done.