Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down
117 changes: 59 additions & 58 deletions docs/Configuration.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/configuration.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@
}
}
},
"installOperator": {
"type": [
"boolean",
"null"
],
"description": "Installs ArgoCD Operator itself"
},
"namespace" : {
"type" : [ "string", "null" ],
"description" : "Defines the kubernetes namespace for ArgoCD"
Expand All @@ -320,6 +327,13 @@
"type" : [ "boolean", "null" ],
"description" : "Install ArgoCD via an already running ArgoCD Operator"
},
"operatorVersion": {
"type": [
"string",
"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"
Expand Down
9 changes: 8 additions & 1 deletion src/main/groovy/com/cloudogu/gitops/config/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
String operatorVersion = '0.17'

@Option(names = ['--argocd-url'], description = ARGOCD_URL_DESCRIPTION)
@JsonPropertyDescription(ARGOCD_URL_DESCRIPTION)
String url = ''
Expand Down Expand Up @@ -777,4 +784,4 @@ class Config {
new YAMLMapper()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class ArgoCD extends Tool {

if (config.features.argocd.operator) {
generateRBAC()
if (config.features.argocd.installOperator) { installOperator() }
deployWithOperator()
} else {
if (this.config.features.argocd?.values) {
Expand Down Expand Up @@ -184,6 +185,12 @@ class ArgoCD extends Tool {
k8sClient.applyYaml("${argocdRbacPath} --recursive")
}

private void installOperator() {
String version = config.features.argocd.operatorVersion
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}")
}

private void deployWithHelm() {

// Install umbrella chart from argocd/argocd
Expand Down Expand Up @@ -322,4 +329,4 @@ class ArgoCD extends Tool {
return this.repoSetup
}

}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,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: ""
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ features:
argocd:
active: true
operator: true
installOperator: true
resourceInclusionsCluster: "https://10.43.0.1:443"
jenkins:
active: true
Expand Down Expand Up @@ -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: ""
3 changes: 2 additions & 1 deletion src/main/resources/application-operator-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ features:
argocd:
active: true
operator: true
installOperator: true
resourceInclusionsCluster: "https://10.43.0.1:443"
ingress:
active: true
Expand Down Expand Up @@ -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: ""
4 changes: 2 additions & 2 deletions src/main/resources/application-operator-mandants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ features:
argocd:
active: true
operator: false
installOperator: true
env: []
resourceInclusionsCluster: "https://10.43.0.1:443"
ingress:
Expand All @@ -39,5 +40,4 @@ content:

namespaces:
- tenant1-argocd
variables:

variables:
3 changes: 2 additions & 1 deletion src/main/resources/application-operator-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"