You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
folderStructureStrategy: 'GLOBAL_ENV', /* or ENV_PER_APP */
142
160
stages: [
143
161
staging: [
144
162
namespace: 'my-staging',
@@ -262,7 +280,7 @@ See [Example of ArgoCD application in GitOps Playground](https://github.com/clou
262
280
263
281
---
264
282
265
-
## Default Folder Structure
283
+
## Default Folder Structure in source repository
266
284
267
285
A default project structure in your application repo could look like the examples below. Make sure you have your k8s
268
286
and/or helm resources bundled in a folder. This specific resources folder (here `k8s`) will later be specified by the
@@ -317,7 +335,7 @@ First of all there are some mandatory properties e.g. the information about your
317
335
* `gitopsTool: 'ARGO'` - Name of the gitops tool. Currently supporting `'FLUX'` (for now only fluxV1) and `'ARGO'`.
318
336
* and some optional parameters (below are the defaults) for the configuration of the dependency to the ces-build-lib or the default name for the git branch:
@@ -326,40 +344,37 @@ First of all there are some mandatory properties e.g. the information about your
326
344
The GitOps-build-lib uses some docker images internally (To run Helm or Kubectl commands and specific Validators inside a docker container).
327
345
All of these have set default images, but you can change them if you wish to.
328
346
347
+
```groovy
348
+
def gitopsConfig = [
349
+
buildImages: [
350
+
// These are used to run helm and kubectl commands in the core logic
351
+
helm: 'ghcr.io/cloudogu/helm:3.5.4-1',
352
+
kubectl: 'lachlanevenson/k8s-kubectl:v1.19.3',
353
+
// These are used for each specific validator via an imageRef property inside the validators config. See [Validators] for examples.
354
+
kubeval: 'ghcr.io/cloudogu/helm:3.5.4-1',
355
+
helmKubeval: 'ghcr.io/cloudogu/helm:3.5.4-1',
356
+
yamllint: 'cytopia/yamllint:1.25-0.7'
357
+
]
358
+
]
359
+
```
360
+
361
+
Optional - if image is in a private repository, you can pass a `credentialsId` for pulling images.
362
+
329
363
```groovy
330
364
def gitopsConfig = [
331
365
buildImages: [
332
-
// These are used to run helm and kubectl commands in the core logic
333
-
//
334
366
helm: [
335
-
image: 'ghcr.io/cloudogu/helm:3.5.4-1'
336
-
credentialsId: 'myCredentials' (optional - only needed if image is in a private repository. CredentialsId is getting pulled from Jenkins credentials)
367
+
image: 'ghcr.io/cloudogu/helm:3.11.1-2',
368
+
credentialsId: 'myCredentials'
337
369
],
338
-
kubectl: [
339
-
image: 'lachlanevenson/k8s-kubectl:v1.19.3'
340
-
credentialsId: 'myCredentials' (optional - only needed if image is in a private repository. CredentialsId is getting pulled from Jenkins credentials)
341
-
],
342
-
// These are used for each specific validator via an imageRef property inside the validators config. See [Validators] for examples.
343
-
kubeval: [
344
-
image: 'ghcr.io/cloudogu/helm:3.5.4-1'
345
-
credentialsId: 'myCredentials' (optional - only needed if image is in a private repository. CredentialsId is getting pulled from Jenkins credentials)
346
-
],
347
-
helmKubeval: [
348
-
image: 'ghcr.io/cloudogu/helm:3.5.4-1'
349
-
credentialsId: 'myCredentials' (optional - only needed if image is in a private repository. CredentialsId is getting pulled from Jenkins credentials)
350
-
],
351
-
yamllint: [
352
-
image: 'cytopia/yamllint:1.25-0.7'
353
-
credentialsId: 'myCredentials' (optional - only needed if image is in a private repository. CredentialsId is getting pulled from Jenkins credentials)
354
-
]
370
+
// ...
355
371
]
356
372
]
357
373
```
358
374
359
375
## Stages
360
376
The GitOps-build-lib supports builds on multiple stages. A stage is defined by a name and contains a namespace (used to
361
-
generate the resources) and a deployment-flag. If no stages is passed into the gitops-config by the user, the default
362
-
is set to:
377
+
generate the resources) and a deployment-flag:
363
378
364
379
```groovy
365
380
def gitopsConfig = [
@@ -376,7 +391,6 @@ def gitopsConfig = [
376
391
]
377
392
```
378
393
379
-
The defaults above can be overwritten by providing an entry for 'stages' within your config.
380
394
If it is set to deploy directly it will commit and push to your desired `gitops-folder` and therefore triggers a deployment. If it is set to false
381
395
it will create a PR on your `gitops-folder`. **Remember** there are important conventions regarding namespaces and the folder structure (see [namespaces](#namespaces)).
382
396
@@ -509,6 +523,7 @@ The deployment has to contain the path of your k8s resources within the applicat
509
523
def gitopsConfig = [
510
524
deployments: [
511
525
sourcePath: 'k8s', // path of k8s resources in application repository. Default: 'k8s'
526
+
destinationRootPath: '.', // Root-Subfolder in the gitops repository, where the following folders for stages and apps shall be created. Default: '.'
512
527
// Either "plain" or "helm" is mandatory
513
528
plain: [], // use plain if you only have, as the name suggests, plain k8s resources
514
529
helm: [] // or if you want to deploy a helm release use `helm`
@@ -601,6 +616,29 @@ We decided to generate plain k8s Resources from Helm applications before we push
601
616
602
617
---
603
618
619
+
## Folder Structure in destination gitops repository
620
+
621
+
You can customize in which path the final manifests of the application will be created in the gitops repository. For this, you can modify the following parameters:
622
+
```groovy
623
+
def gitopsConfig = [
624
+
deployments: [
625
+
destinationRootPath: '.' /* Default: '.' */
626
+
],
627
+
folderStructureStrategy: 'GLOBAL_ENV' /* Default: 'GLOBAL_ENV', or ENV_PER_APP */
628
+
]
629
+
```
630
+
*`destinationRootPath`: Specifies in which subfolder the following folders of `folderStructureStrategy` are created. Defaults to the root of the repository.
631
+
*`folderStructureStrategy`: Possible values:
632
+
*`GLOBAL_ENV`: The manifests will be commited into `$DESTINATION_ROOT_PATH/STAGE_NAME/APP_NAME/` in the destination gitops repository
633
+
*`ENV_PER_APP`: The manifests will be commited into `$DESTINATION_ROOT_PATH/APP_NAME/STAGE_NAME/` in the destination gitops repository
634
+
635
+
636
+
Example for **Global Environments** vs **Environment per App** ([Source](https://github.com/cloudogu/gitops-patterns#implementing-release-promotion)):
0 commit comments