From d3a87649619234456404fe9a58c8f4ddc7b9fc01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Fri, 15 May 2026 14:04:43 +0200 Subject: [PATCH 1/6] install with operator --- docs/Configuration.md | 117 +++++++++--------- docs/configuration.schema.json | 14 +++ .../com/cloudogu/gitops/config/Config.groovy | 9 +- .../gitops/config/ConfigConstants.groovy | 4 +- .../gitops/features/argocd/ArgoCD.groovy | 19 ++- 5 files changed, 102 insertions(+), 61 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 2063bb242..f409fa5a7 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -42,22 +42,22 @@ All options can be set via a [config file](./configuration.schema.json). Most op ## Jenkins -| CLI | Config key | Type | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| `--jenkins` | `jenkins.active` | Boolean | `false` | Installs Jenkins as CI server | -| `--jenkins-skip-restart` | `jenkins.skipRestart` | Boolean | `false` | Skips restarting Jenkins after plugin installation. Use with caution! If the plugins are not installed up front, the installation will likely fail. The intended use case for this is after the first installation, for config changes only. Do not use on first installation or upgrades. | -| `--jenkins-skip-plugins` | `jenkins.skipPlugins` | Boolean | `false` | Skips plugin installation. Use with caution! If the plugins are not installed up front, the installation will likely fail. The intended use case for this is after the first installation, for config changes only. Do not use on first installation or upgrades. | -| `--jenkins-url` | `jenkins.url` | String | `` | The url of your external jenkins | -| `--jenkins-username` | `jenkins.username` | String | `admin` | Mandatory when jenkins-url is set | -| `--jenkins-password` | `jenkins.password` | String | `mK1KDmJOeg6Y` | Mandatory when jenkins-url is set | -| `--jenkins-metrics-username` | `jenkins.metricsUsername` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | -| `--jenkins-metrics-password` | `jenkins.metricsPassword` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | -| `--maven-central-mirror` | `jenkins.mavenCentralMirror` | String | `` | URL for maven mirror, used by applications built in Jenkins | -| `--jenkins-additional-envs` | `jenkins.additionalEnvs` | Map | `[:]` | Set additional environments to Jenkins | -| - | `jenkins.helm.values` | Map | `[:]` | Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration | -| - | `jenkins.helm.chart` | String | `jenkins` | Name of the Helm chart | -| - | `jenkins.helm.repoURL` | String | `https://charts.jenkins.io` | Repository url from which the Helm chart should be obtained | -| - | `jenkins.helm.version` | String | `5.9.18` | The version of the Helm chart to be installed | +| CLI | Config key | Type | Default | Description | +|:-----------------------------|:-----------------------------|:--------|:----------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--jenkins` | `jenkins.active` | Boolean | `false` | Installs Jenkins as CI server | +| `--jenkins-skip-restart` | `jenkins.skipRestart` | Boolean | `false` | Skips restarting Jenkins after plugin installation. Use with caution! If the plugins are not installed up front, the installation will likely fail. The intended use case for this is after the first installation, for config changes only. Do not use on first installation or upgrades. | +| `--jenkins-skip-plugins` | `jenkins.skipPlugins` | Boolean | `false` | Skips plugin installation. Use with caution! If the plugins are not installed up front, the installation will likely fail. The intended use case for this is after the first installation, for config changes only. Do not use on first installation or upgrades. | +| `--jenkins-url` | `jenkins.url` | String | `` | The url of your external jenkins | +| `--jenkins-username` | `jenkins.username` | String | `admin` | Mandatory when jenkins-url is set | +| `--jenkins-password` | `jenkins.password` | String | `TqMl80IVjBuH` | Mandatory when jenkins-url is set | +| `--jenkins-metrics-username` | `jenkins.metricsUsername` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | +| `--jenkins-metrics-password` | `jenkins.metricsPassword` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | +| `--maven-central-mirror` | `jenkins.mavenCentralMirror` | String | `` | URL for maven mirror, used by applications built in Jenkins | +| `--jenkins-additional-envs` | `jenkins.additionalEnvs` | Map | `[:]` | Set additional environments to Jenkins | +| - | `jenkins.helm.values` | Map | `[:]` | Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration | +| - | `jenkins.helm.chart` | String | `jenkins` | Name of the Helm chart | +| - | `jenkins.helm.repoURL` | String | `https://charts.jenkins.io` | Repository url from which the Helm chart should be obtained | +| - | `jenkins.helm.version` | String | `5.9.18` | The version of the Helm chart to be installed | ## Multi Tenant @@ -99,34 +99,34 @@ All options can be set via a [config file](./configuration.schema.json). Most op ## Application -| CLI | Config key | Type | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| `--config-file` | `application.configFiles` | List<String> | `[]` | - | -| `--config-map` | `application.configMaps` | List<String> | `[]` | - | -| `-d`, `--debug` | `application.debug` | Boolean | `-` | - | -| `-x`, `--trace` | `application.trace` | Boolean | `-` | - | -| `--output-config-file` | `application.outputConfigFile` | Boolean | `false` | - | -| `-v`, `--version` | `application.versionInfoRequested` | Boolean | `false` | - | -| `-h`, `--help` | `application.usageHelpRequested` | Boolean | `false` | - | -| `--insecure` | `application.insecure` | Boolean | `false` | Sets insecure-mode in cURL which skips cert validation | -| `--openshift` | `application.openshift` | Boolean | `false` | When set, openshift specific resources and configurations are applied | -| `--username` | `application.username` | String | `admin` | Set initial admin username | -| `--password` | `application.password` | String | `mK1KDmJOeg6Y` | Set initial admin passwords | -| `-y`, `--yes` | `application.yes` | Boolean | `false` | Skip confirmation | -| `--name-prefix` | `application.namePrefix` | String | `` | Set name-prefix for repos, jobs, namespaces | -| `--destroy` | `application.destroy` | Boolean | `false` | Unroll playground | -| `--pod-resources` | `application.podResources` | Boolean | `false` | Write kubernetes resource requests and limits on each pod | -| `--git-name` | `application.gitName` | String | `Cloudogu` | Sets git author and committer name used for initial commits | -| `--git-email` | `application.gitEmail` | String | `hello@cloudogu.com` | Sets git author and committer email used for initial commits | -| `--base-url` | `application.baseUrl` | String | `` | the external base url (TLD) for all tools, e.g. https://example.com or http://localhost:8080. The individual -url params for argocd, grafana and vault take precedence. | -| `--url-separator-hyphen` | `application.urlSeparatorHyphen` | Boolean | `false` | Use hyphens instead of dots to separate application name from base-url | -| `--mirror-repos` | `application.mirrorRepos` | Boolean | `false` | Changes the sources of deployed tools so they are not pulled from the internet, but are pulled from git and work in air-gapped environments. | -| `--skip-crds` | `application.skipCrds` | Boolean | `false` | Skip installation of CRDs. This requires prior installation of CRDs | -| `--namespace-isolation` | `application.namespaceIsolation` | Boolean | `false` | Configure tools to explicitly work with the given namespaces only, and not cluster-wide. This way GOP can be installed without having cluster-admin permissions. | -| `--netpols` | `application.netpols` | Boolean | `false` | Sets Network Policies | -| `--cluster-admin` | `application.clusterAdmin` | Boolean | `false` | Binds ArgoCD controllers to cluster-admin ClusterRole | -| `-p`, `--profile` | `application.profile` | String | `-` | Use predefined profile (full, only-argocd, operator-mandants aso.) | -| `--gop-namespace` | `application.gopNamespace` | String | `` | If set, GOP stores specific information in this namespace. | +| CLI | Config key | Type | Default | Description | +|:-------------------------|:-----------------------------------|:-------------------|:---------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--config-file` | `application.configFiles` | List<String> | `[]` | - | +| `--config-map` | `application.configMaps` | List<String> | `[]` | - | +| `-d`, `--debug` | `application.debug` | Boolean | `-` | - | +| `-x`, `--trace` | `application.trace` | Boolean | `-` | - | +| `--output-config-file` | `application.outputConfigFile` | Boolean | `false` | - | +| `-v`, `--version` | `application.versionInfoRequested` | Boolean | `false` | - | +| `-h`, `--help` | `application.usageHelpRequested` | Boolean | `false` | - | +| `--insecure` | `application.insecure` | Boolean | `false` | Sets insecure-mode in cURL which skips cert validation | +| `--openshift` | `application.openshift` | Boolean | `false` | When set, openshift specific resources and configurations are applied | +| `--username` | `application.username` | String | `admin` | Set initial admin username | +| `--password` | `application.password` | String | `TqMl80IVjBuH` | Set initial admin passwords | +| `-y`, `--yes` | `application.yes` | Boolean | `false` | Skip confirmation | +| `--name-prefix` | `application.namePrefix` | String | `` | Set name-prefix for repos, jobs, namespaces | +| `--destroy` | `application.destroy` | Boolean | `false` | Unroll playground | +| `--pod-resources` | `application.podResources` | Boolean | `false` | Write kubernetes resource requests and limits on each pod | +| `--git-name` | `application.gitName` | String | `Cloudogu` | Sets git author and committer name used for initial commits | +| `--git-email` | `application.gitEmail` | String | `hello@cloudogu.com` | Sets git author and committer email used for initial commits | +| `--base-url` | `application.baseUrl` | String | `` | the external base url (TLD) for all tools, e.g. https://example.com or http://localhost:8080. The individual -url params for argocd, grafana and vault take precedence. | +| `--url-separator-hyphen` | `application.urlSeparatorHyphen` | Boolean | `false` | Use hyphens instead of dots to separate application name from base-url | +| `--mirror-repos` | `application.mirrorRepos` | Boolean | `false` | Changes the sources of deployed tools so they are not pulled from the internet, but are pulled from git and work in air-gapped environments. | +| `--skip-crds` | `application.skipCrds` | Boolean | `false` | Skip installation of CRDs. This requires prior installation of CRDs | +| `--namespace-isolation` | `application.namespaceIsolation` | Boolean | `false` | Configure tools to explicitly work with the given namespaces only, and not cluster-wide. This way GOP can be installed without having cluster-admin permissions. | +| `--netpols` | `application.netpols` | Boolean | `false` | Sets Network Policies | +| `--cluster-admin` | `application.clusterAdmin` | Boolean | `false` | Binds ArgoCD controllers to cluster-admin ClusterRole | +| `-p`, `--profile` | `application.profile` | String | `-` | Use predefined profile (full, only-argocd, operator-mandants aso.) | +| `--gop-namespace` | `application.gopNamespace` | String | `` | If set, GOP stores specific information in this namespace. | ## Content @@ -145,18 +145,20 @@ Configuration of optional features supported by gitops-playground. ### Feature: Argocd -| CLI | Config key | Type | Default | Description | -| :--- | :--- | :--- | :--- | :--- | -| `--argocd` | `features.argocd.active` | Boolean | `false` | Install ArgoCD | -| `--argocd-operator` | `features.argocd.operator` | Boolean | `false` | Install ArgoCD via an already running ArgoCD Operator | -| `--argocd-url` | `features.argocd.url` | String | `` | The URL where argocd is accessible. It has to be the full URL with http:// or https:// | -| - | `features.argocd.env` | List<java.util.Map> | `-` | Pass a list of env vars to Argo CD components. Currently only works with operator | -| `--argocd-email-from` | `features.argocd.emailFrom` | String | `argocd@example.org` | Notifications, define Argo CD sender email address | -| `--argocd-email-to-user` | `features.argocd.emailToUser` | String | `app-team@example.org` | Notifications, define Argo CD user / app-team recipient email address | -| `--argocd-email-to-admin` | `features.argocd.emailToAdmin` | String | `infra@example.org` | Notifications, define Argo CD admin recipient email address | -| `--argocd-resource-inclusions-cluster` | `features.argocd.resourceInclusionsCluster` | String | `` | Internal Kubernetes API Server URL https://IP:PORT (kubernetes.default.svc). Needed in argocd-operator resourceInclusions. Use this parameter if argocd.operator=true and NOT running inside a Pod (remote mode). Full URL needed, for example: https://100.125.0.1:443 | -| `--argocd-namespace` | `features.argocd.namespace` | String | `argocd` | Defines the kubernetes namespace for ArgoCD | -| - | `features.argocd.values` | Map | `[:]` | Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration | +| CLI | Config key | Type | Default | Description | +|:---------------------------------------|:--------------------------------------------|:--------------------------------------------------------------|:-----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--argocd` | `features.argocd.active` | Boolean | `false` | Install ArgoCD | +| `--argocd-operator` | `features.argocd.operator` | Boolean | `false` | Install ArgoCD via an already running ArgoCD Operator | +| `--install-argocd-operator` | `features.argocd.installOperator` | Boolean | `false` | Installs ArgoCD Operator itself | +| - | `features.argocd.operatorVersion` | Boolean | `true` | Operator Version to install | +| `--argocd-url` | `features.argocd.url` | String | `` | The URL where argocd is accessible. It has to be the full URL with http:// or https:// | +| - | `features.argocd.env` | List<java.util.Map> | `-` | Pass a list of env vars to Argo CD components. Currently only works with operator | +| `--argocd-email-from` | `features.argocd.emailFrom` | String | `argocd@example.org` | Notifications, define Argo CD sender email address | +| `--argocd-email-to-user` | `features.argocd.emailToUser` | String | `app-team@example.org` | Notifications, define Argo CD user / app-team recipient email address | +| `--argocd-email-to-admin` | `features.argocd.emailToAdmin` | String | `infra@example.org` | Notifications, define Argo CD admin recipient email address | +| `--argocd-resource-inclusions-cluster` | `features.argocd.resourceInclusionsCluster` | String | `` | Internal Kubernetes API Server URL https://IP:PORT (kubernetes.default.svc). Needed in argocd-operator resourceInclusions. Use this parameter if argocd.operator=true and NOT running inside a Pod (remote mode). Full URL needed, for example: https://100.125.0.1:443 | +| `--argocd-namespace` | `features.argocd.namespace` | String | `argocd` | Defines the kubernetes namespace for ArgoCD | +| - | `features.argocd.values` | Map | `[:]` | Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration | ### Feature: Mail @@ -228,5 +230,4 @@ Configuration of optional features supported by gitops-playground. | - | `features.certManager.helm.values` | Map | `[:]` | Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration | | - | `features.certManager.helm.chart` | String | `cert-manager` | Name of the Helm chart | | - | `features.certManager.helm.repoURL` | String | `https://charts.jetstack.io` | Repository url from which the Helm chart should be obtained | -| - | `features.certManager.helm.version` | String | `1.19.4` | The version of the Helm chart to be installed | - +| - | `features.certManager.helm.version` | String | `1.19.4` | The version of the Helm chart to be installed | \ No newline at end of file diff --git a/docs/configuration.schema.json b/docs/configuration.schema.json index cb53e6bca..fe1ec20d4 100644 --- a/docs/configuration.schema.json +++ b/docs/configuration.schema.json @@ -312,6 +312,13 @@ } } }, + "installOperator": { + "type": [ + "boolean", + "null" + ], + "description": "Installs ArgoCD Operator itself" + }, "namespace" : { "type" : [ "string", "null" ], "description" : "Defines the kubernetes namespace for ArgoCD" @@ -320,6 +327,13 @@ "type" : [ "boolean", "null" ], "description" : "Install ArgoCD via an already running ArgoCD Operator" }, + "operatorVersion": { + "type": [ + "boolean", + "null" + ], + "description": "Operator Version to install" + }, "resourceInclusionsCluster" : { "type" : [ "string", "null" ], "description" : "Internal Kubernetes API Server URL https://IP:PORT (kubernetes.default.svc). Needed in argocd-operator resourceInclusions. Use this parameter if argocd.operator=true and NOT running inside a Pod (remote mode). Full URL needed, for example: https://100.125.0.1:443" diff --git a/src/main/groovy/com/cloudogu/gitops/config/Config.groovy b/src/main/groovy/com/cloudogu/gitops/config/Config.groovy index 441e0a26a..07b1988c8 100644 --- a/src/main/groovy/com/cloudogu/gitops/config/Config.groovy +++ b/src/main/groovy/com/cloudogu/gitops/config/Config.groovy @@ -510,6 +510,13 @@ class Config { @JsonPropertyDescription(ARGOCD_OPERATOR_DESCRIPTION) Boolean operator = false + @Option(names = ['--install-argocd-operator'], description = ARGOCD_INSTALL_OPERATOR_DESCRIPTION) + @JsonPropertyDescription(ARGOCD_INSTALL_OPERATOR_DESCRIPTION) + Boolean installOperator = false + + @JsonPropertyDescription(ARGOCD_INSTALL_OPERATOR_VERSION_DESCRIPTION) + Boolean operatorVersion = '0.17' + @Option(names = ['--argocd-url'], description = ARGOCD_URL_DESCRIPTION) @JsonPropertyDescription(ARGOCD_URL_DESCRIPTION) String url = '' @@ -777,4 +784,4 @@ class Config { new YAMLMapper() } } -} +} \ No newline at end of file diff --git a/src/main/groovy/com/cloudogu/gitops/config/ConfigConstants.groovy b/src/main/groovy/com/cloudogu/gitops/config/ConfigConstants.groovy index f179575f8..bbe3d04ba 100644 --- a/src/main/groovy/com/cloudogu/gitops/config/ConfigConstants.groovy +++ b/src/main/groovy/com/cloudogu/gitops/config/ConfigConstants.groovy @@ -144,6 +144,8 @@ interface ConfigConstants { String ARGOCD_EMAIL_TO_USER_DESCRIPTION = 'Notifications, define Argo CD user / app-team recipient email address' String ARGOCD_EMAIL_TO_ADMIN_DESCRIPTION = 'Notifications, define Argo CD admin recipient email address' String ARGOCD_OPERATOR_DESCRIPTION = 'Install ArgoCD via an already running ArgoCD Operator' + String ARGOCD_INSTALL_OPERATOR_DESCRIPTION = 'Installs ArgoCD Operator itself' + String ARGOCD_INSTALL_OPERATOR_VERSION_DESCRIPTION = 'Operator Version to install' String ARGOCD_ENV_DESCRIPTION = 'Pass a list of env vars to Argo CD components. Currently only works with operator' String ARGOCD_RESOURCE_INCLUSIONS_CLUSTER = 'Internal Kubernetes API Server URL https://IP:PORT (kubernetes.default.svc). Needed in argocd-operator resourceInclusions. Use this parameter if argocd.operator=true and NOT running inside a Pod (remote mode). Full URL needed, for example: https://100.125.0.1:443' String ARGOCD_CUSTOM_NAMESPACE_DESCRIPTION = 'Defines the kubernetes namespace for ArgoCD' @@ -168,4 +170,4 @@ interface ConfigConstants { String HELM_CONFIG_VERSION_DESCRIPTION = 'The version of the Helm chart to be installed' String HELM_CONFIG_IMAGE_DESCRIPTION = 'The image of the Helm chart to be installed' String HELM_CONFIG_VALUES_DESCRIPTION = 'Helm values of the chart, allows overriding defaults and setting values that are not exposed as explicit configuration' -} +} \ No newline at end of file diff --git a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy index de0325087..0a3a21436 100644 --- a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy +++ b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy @@ -109,6 +109,7 @@ class ArgoCD extends Feature { if (config.features.argocd.operator) { generateRBAC() + if (config.features.argocd.installOperator) { installOperator() } deployWithOperator() } else { if (this.config.features.argocd?.values) { @@ -184,6 +185,22 @@ class ArgoCD extends Feature { k8sClient.applyYaml("${argocdRbacPath} --recursive") } + private void installOperator() { + def cmd = """ +git clone https://github.com/argoproj-labs/argocd-operator && +cd argocd-operator && +git checkout release-${config.features.argocd.operatorVersion} && +make deploy IMG=quay.io/argoprojlabs/argocd-operator:v${config.features.argocd.operatorVersion}.0 && +rm -Rf ../argocd-operator/ +""" + + def process = ["bash", "-c", cmd].execute() + process.in.eachLine { log.debug(it) } + process.err.eachLine { log.debug(it) } + process.waitFor() + log.info("Successfully installed ArgoCD Operator version ${config.features.argocd.operatorVersion}") + } + private void deployWithHelm() { // Install umbrella chart from argocd/argocd @@ -322,4 +339,4 @@ class ArgoCD extends Feature { return this.repoSetup } -} +} \ No newline at end of file From bc3ad18939d957062aa37eb9a9c2cec52b7af646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Thu, 21 May 2026 13:04:54 +0200 Subject: [PATCH 2/6] update for operator --- .../com/cloudogu/gitops/config/Config.groovy | 2 +- .../gitops/features/argocd/ArgoCD.groovy | 16 +++------------- .../gitops/kubernetes/api/K8sClient.groovy | 4 ++++ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main/groovy/com/cloudogu/gitops/config/Config.groovy b/src/main/groovy/com/cloudogu/gitops/config/Config.groovy index 07b1988c8..94f7f8ee5 100644 --- a/src/main/groovy/com/cloudogu/gitops/config/Config.groovy +++ b/src/main/groovy/com/cloudogu/gitops/config/Config.groovy @@ -515,7 +515,7 @@ class Config { Boolean installOperator = false @JsonPropertyDescription(ARGOCD_INSTALL_OPERATOR_VERSION_DESCRIPTION) - Boolean operatorVersion = '0.17' + String operatorVersion = '0.17' @Option(names = ['--argocd-url'], description = ARGOCD_URL_DESCRIPTION) @JsonPropertyDescription(ARGOCD_URL_DESCRIPTION) diff --git a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy index 0a3a21436..f04fae08a 100644 --- a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy +++ b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy @@ -186,19 +186,9 @@ class ArgoCD extends Feature { } private void installOperator() { - def cmd = """ -git clone https://github.com/argoproj-labs/argocd-operator && -cd argocd-operator && -git checkout release-${config.features.argocd.operatorVersion} && -make deploy IMG=quay.io/argoprojlabs/argocd-operator:v${config.features.argocd.operatorVersion}.0 && -rm -Rf ../argocd-operator/ -""" - - def process = ["bash", "-c", cmd].execute() - process.in.eachLine { log.debug(it) } - process.err.eachLine { log.debug(it) } - process.waitFor() - log.info("Successfully installed ArgoCD Operator version ${config.features.argocd.operatorVersion}") + String version = config.features.argocd.operatorVersion + k8sClient.applyKustomize("github.com/argoproj-labs/argocd-operator/config/default?ref=release-${version}") + log.info("Successfully installed ArgoCD Operator version ${version}") } private void deployWithHelm() { diff --git a/src/main/groovy/com/cloudogu/gitops/kubernetes/api/K8sClient.groovy b/src/main/groovy/com/cloudogu/gitops/kubernetes/api/K8sClient.groovy index a4ab82d56..b22bbf8b9 100644 --- a/src/main/groovy/com/cloudogu/gitops/kubernetes/api/K8sClient.groovy +++ b/src/main/groovy/com/cloudogu/gitops/kubernetes/api/K8sClient.groovy @@ -111,6 +111,10 @@ class K8sClient { commandExecutor.execute("kubectl apply -f $yamlLocation").stdOut } + String applyKustomize(String kustomizeLocation) { + commandExecutor.execute("kubectl apply -k $kustomizeLocation").stdOut + } + /** * Creates a namespace with the specified name if it does not already exist. * From 83933e61dcb3dae82eaa367cff10481040a78a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Thu, 21 May 2026 14:02:39 +0200 Subject: [PATCH 3/6] update for operator --- .../gitops/features/argocd/ArgoCD.groovy | 2 +- src/main/resources/application-dev.yaml | 61 +------------------ 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy index f04fae08a..ff3ea1f62 100644 --- a/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy +++ b/src/main/groovy/com/cloudogu/gitops/features/argocd/ArgoCD.groovy @@ -187,7 +187,7 @@ class ArgoCD extends Feature { private void installOperator() { String version = config.features.argocd.operatorVersion - k8sClient.applyKustomize("github.com/argoproj-labs/argocd-operator/config/default?ref=release-${version}") + k8sClient.applyKustomize("github.com/argoproj-labs/argocd-operator/config/default?ref=release-${version} --server-side --force-conflicts") log.info("Successfully installed ArgoCD Operator version ${version}") } diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index 91f27202c..7288e5f01 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -1,71 +1,12 @@ # $schema: https://raw.githubusercontent.com/cloudogu/gitops-playground/main/docs/configuration.schema.json application: - "yes": true baseUrl: http://localhost password: "admin" features: - certManager: - active: true - argocd: - active: true - operator: false - ingress: - active: true - monitoring: - active: true - secrets: - vault: - mode: "dev" jenkins: - active: true password: "admin" registry: - active: true password: "admin" scm: scmManager: - password: "admin" -content: - repos: - - url: https://github.com/cloudogu/gitops-build-lib - target: 3rd-party-dependencies/gitops-build-lib - overwriteMode: RESET - - url: https://github.com/cloudogu/ces-build-lib - target: 3rd-party-dependencies/ces-build-lib - overwriteMode: RESET - - url: https://github.com/cloudogu/spring-boot-helm-chart - target: 3rd-party-dependencies/spring-boot-helm-chart - overwriteMode: RESET - - url: https://github.com/cloudogu/spring-petclinic - target: argocd/petclinic-plain - ref: feature/gitops_ready - targetRef: main - overwriteMode: UPGRADE - createJenkinsJob: true - - url: https://github.com/cloudogu/spring-petclinic - target: argocd/petclinic-helm - ref: feature/gitops_ready - targetRef: main - overwriteMode: UPGRADE - createJenkinsJob: true - - url: https://github.com/cloudogu/gitops-examples - path: example-apps-via-content-loader/ - ref: main - templating: true - type: FOLDER_BASED - overwriteMode: UPGRADE - - namespaces: - - ${config.application.namePrefix}example-apps-production - - ${config.application.namePrefix}example-apps-staging - variables: - petclinic: - baseDomain: "petclinic.localhost" - images: - kubectl: "bitnamilegacy/kubectl:1.29" - helm: "ghcr.io/cloudogu/helm:3.16.4-1" - kubeval: "ghcr.io/cloudogu/helm:3.16.4-1" - helmKubeval: "ghcr.io/cloudogu/helm:3.16.4-1" - yamllint: "cytopia/yamllint:1.25-0.7" - petclinic: "eclipse-temurin:17-jre-alpine" - maven: "" + password: "admin" \ No newline at end of file From 403c127471856eaf7b3332d0224a87b8d4254122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Thu, 21 May 2026 14:05:19 +0200 Subject: [PATCH 4/6] update for operator --- src/main/resources/application-dev.yaml | 61 ++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index 7288e5f01..7e1968a97 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -1,12 +1,71 @@ # $schema: https://raw.githubusercontent.com/cloudogu/gitops-playground/main/docs/configuration.schema.json application: + "yes": true baseUrl: http://localhost password: "admin" features: + certManager: + active: true + argocd: + active: true + operator: false + ingress: + active: true + monitoring: + active: true + secrets: + vault: + mode: "dev" jenkins: + active: true password: "admin" registry: + active: true password: "admin" scm: scmManager: - password: "admin" \ No newline at end of file + password: "admin" +content: + repos: + - url: https://github.com/cloudogu/gitops-build-lib + target: 3rd-party-dependencies/gitops-build-lib + overwriteMode: RESET + - url: https://github.com/cloudogu/ces-build-lib + target: 3rd-party-dependencies/ces-build-lib + overwriteMode: RESET + - url: https://github.com/cloudogu/spring-boot-helm-chart + target: 3rd-party-dependencies/spring-boot-helm-chart + overwriteMode: RESET + - url: https://github.com/cloudogu/spring-petclinic + target: argocd/petclinic-plain + ref: feature/gitops_ready + targetRef: main + overwriteMode: UPGRADE + createJenkinsJob: true + - url: https://github.com/cloudogu/spring-petclinic + target: argocd/petclinic-helm + ref: feature/gitops_ready + targetRef: main + overwriteMode: UPGRADE + createJenkinsJob: true + - url: https://github.com/cloudogu/gitops-examples + path: example-apps-via-content-loader/ + ref: main + templating: true + type: FOLDER_BASED + overwriteMode: UPGRADE + + namespaces: + - ${config.application.namePrefix}example-apps-production + - ${config.application.namePrefix}example-apps-staging + variables: + petclinic: + baseDomain: "petclinic.localhost" + images: + kubectl: "bitnamilegacy/kubectl:1.29" + helm: "ghcr.io/cloudogu/helm:3.16.4-1" + kubeval: "ghcr.io/cloudogu/helm:3.16.4-1" + helmKubeval: "ghcr.io/cloudogu/helm:3.16.4-1" + yamllint: "cytopia/yamllint:1.25-0.7" + petclinic: "eclipse-temurin:17-jre-alpine" + maven: "" \ No newline at end of file From f5dbad48eb26d3ee1b7abe07045d58db502aa1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Thu, 21 May 2026 14:10:03 +0200 Subject: [PATCH 5/6] update for operator --- docs/Configuration.md | 6 +++--- docs/configuration.schema.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index f409fa5a7..0fd98f54f 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -49,7 +49,7 @@ All options can be set via a [config file](./configuration.schema.json). Most op | `--jenkins-skip-plugins` | `jenkins.skipPlugins` | Boolean | `false` | Skips plugin installation. Use with caution! If the plugins are not installed up front, the installation will likely fail. The intended use case for this is after the first installation, for config changes only. Do not use on first installation or upgrades. | | `--jenkins-url` | `jenkins.url` | String | `` | The url of your external jenkins | | `--jenkins-username` | `jenkins.username` | String | `admin` | Mandatory when jenkins-url is set | -| `--jenkins-password` | `jenkins.password` | String | `TqMl80IVjBuH` | Mandatory when jenkins-url is set | +| `--jenkins-password` | `jenkins.password` | String | `` | Mandatory when jenkins-url is set | | `--jenkins-metrics-username` | `jenkins.metricsUsername` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | | `--jenkins-metrics-password` | `jenkins.metricsPassword` | String | `metrics` | Mandatory when jenkins-url is set and monitoring enabled | | `--maven-central-mirror` | `jenkins.mavenCentralMirror` | String | `` | URL for maven mirror, used by applications built in Jenkins | @@ -111,7 +111,7 @@ All options can be set via a [config file](./configuration.schema.json). Most op | `--insecure` | `application.insecure` | Boolean | `false` | Sets insecure-mode in cURL which skips cert validation | | `--openshift` | `application.openshift` | Boolean | `false` | When set, openshift specific resources and configurations are applied | | `--username` | `application.username` | String | `admin` | Set initial admin username | -| `--password` | `application.password` | String | `TqMl80IVjBuH` | Set initial admin passwords | +| `--password` | `application.password` | String | `QrBJZqUhSSPg` | Set initial admin passwords | | `-y`, `--yes` | `application.yes` | Boolean | `false` | Skip confirmation | | `--name-prefix` | `application.namePrefix` | String | `` | Set name-prefix for repos, jobs, namespaces | | `--destroy` | `application.destroy` | Boolean | `false` | Unroll playground | @@ -150,7 +150,7 @@ Configuration of optional features supported by gitops-playground. | `--argocd` | `features.argocd.active` | Boolean | `false` | Install ArgoCD | | `--argocd-operator` | `features.argocd.operator` | Boolean | `false` | Install ArgoCD via an already running ArgoCD Operator | | `--install-argocd-operator` | `features.argocd.installOperator` | Boolean | `false` | Installs ArgoCD Operator itself | -| - | `features.argocd.operatorVersion` | Boolean | `true` | Operator Version to install | +| - | `features.argocd.operatorVersion` | String | `0.17` | Operator Version to install | | `--argocd-url` | `features.argocd.url` | String | `` | The URL where argocd is accessible. It has to be the full URL with http:// or https:// | | - | `features.argocd.env` | List<java.util.Map> | `-` | Pass a list of env vars to Argo CD components. Currently only works with operator | | `--argocd-email-from` | `features.argocd.emailFrom` | String | `argocd@example.org` | Notifications, define Argo CD sender email address | diff --git a/docs/configuration.schema.json b/docs/configuration.schema.json index fe1ec20d4..7ecca87cd 100644 --- a/docs/configuration.schema.json +++ b/docs/configuration.schema.json @@ -329,7 +329,7 @@ }, "operatorVersion": { "type": [ - "boolean", + "string", "null" ], "description": "Operator Version to install" From dc7994595ada28945aa0ba1ab3be7cb70f975376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hu=C3=9Fmann?= Date: Thu, 21 May 2026 14:29:38 +0200 Subject: [PATCH 6/6] profiles and jenkinsfile --- Jenkinsfile | 7 ------- .../resources/application-operator-content-examples.yaml | 3 ++- src/main/resources/application-operator-full.yaml | 3 ++- src/main/resources/application-operator-mandants.yaml | 4 ++-- src/main/resources/application-operator-minimal.yaml | 3 ++- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 28b3e1315..87b6f0fd0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -116,13 +116,6 @@ pipeline { profiles.each { profile -> withK3dCluster { - - if (profile.startsWith('operator')) { - docker.image("${env.GOLANG_IMAGE}").inside(env.INTEGRATION_TEST_DOCKER_ARGS) { - sh 'apk add --no-cache make bash curl git kubectl && ./scripts/local/install-argocd-operator.sh' - } - } - docker.image("${env.FULL_IMAGE_TAG}").inside(env.INTEGRATION_TEST_DOCKER_ARGS) { sh "java -jar /app/gitops-playground.jar --profile=${profile}" } diff --git a/src/main/resources/application-operator-content-examples.yaml b/src/main/resources/application-operator-content-examples.yaml index 686dbc052..7b10dde8f 100644 --- a/src/main/resources/application-operator-content-examples.yaml +++ b/src/main/resources/application-operator-content-examples.yaml @@ -7,6 +7,7 @@ features: argocd: active: true operator: true + installOperator: true resourceInclusionsCluster: "https://10.43.0.1:443" jenkins: active: true @@ -55,4 +56,4 @@ content: helmKubeval: "ghcr.io/cloudogu/helm:3.16.4-1" yamllint: "cytopia/yamllint:1.25-0.7" petclinic: "eclipse-temurin:17-jre-alpine" - maven: "" + maven: "" \ No newline at end of file diff --git a/src/main/resources/application-operator-full.yaml b/src/main/resources/application-operator-full.yaml index 10523f15a..8c73c7306 100644 --- a/src/main/resources/application-operator-full.yaml +++ b/src/main/resources/application-operator-full.yaml @@ -9,6 +9,7 @@ features: argocd: active: true operator: true + installOperator: true resourceInclusionsCluster: "https://10.43.0.1:443" ingress: active: true @@ -64,4 +65,4 @@ content: helmKubeval: "ghcr.io/cloudogu/helm:3.16.4-1" yamllint: "cytopia/yamllint:1.25-0.7" petclinic: "eclipse-temurin:17-jre-alpine" - maven: "" + maven: "" \ No newline at end of file diff --git a/src/main/resources/application-operator-mandants.yaml b/src/main/resources/application-operator-mandants.yaml index 06ca3ad4c..add9c663f 100644 --- a/src/main/resources/application-operator-mandants.yaml +++ b/src/main/resources/application-operator-mandants.yaml @@ -21,6 +21,7 @@ features: argocd: active: true operator: false + installOperator: true env: [] resourceInclusionsCluster: "https://10.43.0.1:443" ingress: @@ -39,5 +40,4 @@ content: namespaces: - tenant1-argocd - variables: - + variables: \ No newline at end of file diff --git a/src/main/resources/application-operator-minimal.yaml b/src/main/resources/application-operator-minimal.yaml index cbd694752..c74bf33d7 100644 --- a/src/main/resources/application-operator-minimal.yaml +++ b/src/main/resources/application-operator-minimal.yaml @@ -6,4 +6,5 @@ features: argocd: active: true operator: true - resourceInclusionsCluster: "https://10.43.0.1:443" + installOperator: true + resourceInclusionsCluster: "https://10.43.0.1:443" \ No newline at end of file