Skip to content
Merged
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
60 changes: 55 additions & 5 deletions docs/modules/ROOT/pages/running/gitops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ NOTE: There are more options to configure on the `gitops` trait. Feel free to ha

As soon as the build of the Integration is completed, the operator will prepare the commit with the overlays. The structure would be like the following directory tree:

```
```bash
/integrations/
├── all
│   └── overlays
│   ├── production
│   │   └── kustomization.yaml
│   └── staging
│   └── kustomization.yaml
└── sample
├── base
│   ├── integration.yaml
Expand All @@ -60,7 +66,6 @@ As soon as the build of the Integration is completed, the operator will prepare
│   └── patch-integration.yaml
└── routes
└── XYZ.java

```

The above structure could be used directly with `kubectl` (eg, `kubectl apply -k /tmp/integrations/sample/overlays/production`) or any CICD capable of running a similar deployment strategy.
Expand Down Expand Up @@ -114,8 +119,8 @@ As you're pushing the changes on a branch, you may want to use the branch and cr

argo-cd.readthedocs.io[ArgoCD] is one of the most popular CICD choices around. Once you have stored the project in a Git repository, if you're using a CICD technology like ArgoCD you can run your *production* pipeline as:

```
argocd app create my-ck-it-prod --repo https://git-server/repo/integrations/sample.git --path overlays/production --dest-server https://kubernetes.default.svc --dest-namespace prod
```bash
argocd app create my-sample-prod --repo https://git-server/repo/integrations/sample.git --path integrations/sample/overlays/production --dest-server https://kubernetes.default.svc --dest-namespace prod
```

From this moment onward any change can be performed on the repository and it will be automatically refreshed by the CICD pipeline accordingly.
Expand All @@ -128,7 +133,52 @@ The GitOps feature makes it possible to have a physical separated cluster for ea

=== Single repository for multiple Camel applications

You can have a single repository that will contain all your Integrations. If you have noticed, the Integrations will be added to an `integrations` root directory (you can configure it if you need). This is on purpose, as you may want a single repo with all your Kubernetes resources and some CICD just watching at them. So, the `integrations` will contain all your Integrations built and ready to run.
You can have a single repository that will contain "all" your Integrations. If you have noticed, the Integrations will be added to an `integrations` root directory (you can configure it if you need). This is on purpose, as you may want a single repo with all your Kubernetes resources and some CICD just watching at them. So, the `integrations` will contain all your Integrations built and ready to run.

Let's have a look again at the tree structure:

```bash
/integrations/
├── all
│   └── overlays
│   ├── production
│   │   └── kustomization.yaml
│   └── staging
│   └── kustomization.yaml
└── sample1
...
├── overlays
│   ├── production
...
│   └── staging
...
└── sample2
...
│   └── overlays
│   ├── production
...
│   └── staging
...
```

Notice the `all` directory which contains the same overlays structure as the Integrations. The `kustomization.yaml` contains a list of all the Integrations provided in this repository:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: production
resources:
- ../../../sample-1/overlays/production/
- ../../../sample-2/overlays/production/
```

Your single repository containing all Integrations can be therefore referenced in a unique CICD. In the case of ArgoCD, it would be something like:

```bash
argocd app create my-integrations-prod --repo https://git-server/repo/integrations.git --path integrations/all/overlays/production --dest-server https://kubernetes.default.svc --dest-namespace prod
```

This pipeline is in charge to control **all** your Integration in a single place, which could be something you really want to achieve if you have a large number of Integrations that you want to synchronize in a single place.

NOTE: this is the approach suggested in https://developers.redhat.com/e-books/path-gitops["The Path to GitOps"] book.

Expand Down
10 changes: 8 additions & 2 deletions docs/modules/ROOT/pages/running/promoting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ The result will be a directory with the following structure:
```
$ tree /tmp/integrations/
/tmp/integrations/
├── all
│   └── overlays
│   ├── production
│   │   └── kustomization.yaml
│   └── staging
│   └── kustomization.yaml
└── promote-server
├── base
│   ├── integration.yaml
Expand All @@ -93,9 +99,9 @@ $ tree /tmp/integrations/
│   └── patch-integration.yaml
└── routes
└── PromoteServer.java

6 directories, 7 files
```
The `all` directory contains an overlay structure for all the Integrations that are included in this project. This is of great help when you want to use the `promote` tool to append any other Integration to the same project. Beside adding the Integration specific resources (as described in the next paragraph), we include a `all` profile and add in the `kustomization.yaml` file the specific overlay of each new Integration added. Running `kubectl apply -k /tmp/integrations/all/overlays/production` will include all the Integrations added in such a profile.

The `promote-server` directory contains the Integration named as `promote-server` (the one we created in the previous chapter). Then, you can see a *base* directory which contains the base Integration custom resource. Additionally you will find the *staging* and *production* overlays which contains the patches you may want to apply in each given environment.

```
Expand Down
64 changes: 0 additions & 64 deletions helm/camel-k/crds/camel-k-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4345,12 +4345,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -4365,21 +4363,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -6766,12 +6758,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -6786,21 +6776,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -9089,12 +9073,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -9109,21 +9091,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -11389,12 +11365,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -11409,21 +11383,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -20523,12 +20491,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -20543,21 +20509,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -22777,12 +22737,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -22797,21 +22755,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down Expand Up @@ -33272,12 +33224,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes
(default `camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes
(default `Camel K Operator`).
type: string
Expand All @@ -33292,21 +33242,15 @@ spec:
All traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any
existing overlay.
type: boolean
Expand Down Expand Up @@ -35459,12 +35403,10 @@ spec:
description: the git commit (full SHA) to check out.
type: string
committerEmail:
default: camel-k-operator@apache.org
description: The email used to commit the GitOps changes (default
`camel-k-operator@apache.org`).
type: string
committerName:
default: Camel K Operator
description: The name used to commit the GitOps changes (default
`Camel K Operator`).
type: string
Expand All @@ -35479,21 +35421,15 @@ spec:
traits share this common property.
type: boolean
integrationDirectory:
default: integrations
description: The root path where to store Kustomize overlays
(default `integrations`).
type: string
overlays:
default:
- dev
- stag
- prod
description: a list of overlays to provide (default {"dev","stag","prod"}).
items:
type: string
type: array
overwriteOverlay:
default: false
description: a flag (default, false) to overwrite any existing
overlay.
type: boolean
Expand Down
Loading
Loading