Über Open CoDE Software Wiki Diskussionen GitLab

Skip to content

Improving external reusability

openDesk Bot requested to merge gszabo/without-environments into develop

The motivation for the MR is to make this repository more suitable for projects that would like to use it as a remote component for deploying OpenDesk using GitOps principles.

This MR solves the following problems:

  • When we refer to the repository, we can only configure certain parameters through environment variables, such as DOMAIN or MASTER_PASSWORD. This makes it difficult to do a GitOps-based deployment, where the parameters shall be stored in a Git repository.
  • The current codebase defines three environments: dev, test, and prod. When we refer to this repository, it's impossible to redefine or reconfigure these environments.
  • The MR contains some changes to improve the deployment's idempotency. After deployment, if the parameters are not updated, a helmfile apply operation will not perform any action.

After applying the changes of this MR, an external codebase may contain the following helmfile.yaml

environments:
  adfinis:
    values:
      - adfinis-values.yaml
  origoss:
    values:
      - origoss-values.yaml
---
helmfiles:
- path: "git::https://gitlab.opencode.de/bmi/opendesk/deployment/opendesk.git@helmfile.yaml?ref=v0.7.2"
  values:
    - {{ toYaml .Values | nindent 6 }}

Where adfinis-values.yaml defines the parameters specific to the adfinis environment, like this:

global:
  domain: opendesk.cloudlab.k8s-lab.de
  master_password: d3Z99kyRH5z8@

The solution is not complete. The following should also be implemented:

  • Extending the set of parameters that can be configured from an external environment.
  • Improving the idempotency. This will require updates to the downstream Helm charts.
    • I recommend implementing an automated idempotency test. It's rather simple. Two helmfile template operations shall generate the same yaml files.
Edited by Gergely Szabo

Merge request reports