-
Notifications
You must be signed in to change notification settings - Fork 2
add flux, automate deployment if ocm change #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MJarmo
wants to merge
4
commits into
showroom
Choose a base branch
from
showroom-flex
base: showroom
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ee118a7
add flux, automate deployment if ocm change
MJarmo bba83bb
fix flux reconcile setup for showroom branch testing
MJarmo 4c75ca3
ci switch ocm manifest sync to pull-request workflow
MJarmo 486b572
chore(ci): trigger full OCM-to-Flux flow validation
MJarmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - ../../kubectl/tier-1.yaml | ||
| - ../../kubectl/tier-2.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| apiVersion: source.toolkit.fluxcd.io/v1 | ||
| kind: GitRepository | ||
| metadata: | ||
| name: showroom-tier-sync | ||
| namespace: flux-system | ||
| spec: | ||
| interval: 1m | ||
| url: https://github.com/apeirora/audit-log-poc-for-otel.git | ||
| ref: | ||
| branch: showroom | ||
| --- | ||
| apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
| kind: Kustomization | ||
| metadata: | ||
| name: showroom-tier-1-tier-2 | ||
| namespace: flux-system | ||
| spec: | ||
| interval: 1m | ||
| prune: true | ||
| wait: true | ||
| timeout: 3m | ||
| sourceRef: | ||
| kind: GitRepository | ||
| name: showroom-tier-sync | ||
| path: ./showroom/flux/tier-1-tier-2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| version: "3" | ||
|
|
||
| description: Taskfile for Flux reconciliation of tier-1 and tier-2. | ||
|
|
||
| includes: | ||
| tools: | ||
| taskfile: ./tools.yaml | ||
| internal: true | ||
| cluster: | ||
| taskfile: ./cluster.yaml | ||
| internal: true | ||
|
|
||
| tasks: | ||
| install: | ||
| desc: Install Flux GitRepository and Kustomization for tier-1 and tier-2. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| - task: cluster:install | ||
| requires: | ||
| vars: [KUBECTL_CMD] | ||
| preconditions: | ||
| - sh: "{{ .KUBECTL_CMD }} cluster-info >/dev/null 2>&1" | ||
| msg: "Please ensure that you have a k8s-cluster running. Try:\ttask garden:set-kubeconfig" | ||
| - sh: "{{ .KUBECTL_CMD }} get crd gitrepositories.source.toolkit.fluxcd.io >/dev/null 2>&1" | ||
| msg: "Flux CRDs are not installed. Install Flux first and retry." | ||
| cmds: | ||
| - "{{ .KUBECTL_CMD }} apply -f kubectl/flux-tier-1-tier-2.yaml" | ||
| - "{{ .KUBECTL_CMD }} -n flux-system wait --for=condition=Ready gitrepository/showroom-tier-sync --timeout=180s" | ||
| - "{{ .KUBECTL_CMD }} -n flux-system wait --for=condition=Ready kustomization/showroom-tier-1-tier-2 --timeout=180s" | ||
|
|
||
| reconcile: | ||
| desc: Trigger immediate Flux reconciliation for tier-1 and tier-2. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| requires: | ||
| vars: [KUBECTL_CMD] | ||
| cmds: | ||
| - "{{ .KUBECTL_CMD }} -n flux-system annotate --overwrite kustomization/showroom-tier-1-tier-2 reconcile.fluxcd.io/requestedAt=\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"" | ||
| - "{{ .KUBECTL_CMD }} -n flux-system get kustomization showroom-tier-1-tier-2 -o wide" | ||
|
|
||
| status: | ||
| desc: Show Flux status for tier-1 and tier-2 sync. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| requires: | ||
| vars: [KUBECTL_CMD] | ||
| cmds: | ||
| - "{{ .KUBECTL_CMD }} -n flux-system get gitrepository showroom-tier-sync -o wide" | ||
| - "{{ .KUBECTL_CMD }} -n flux-system get kustomization showroom-tier-1-tier-2 -o wide" | ||
|
|
||
| uninstall: | ||
| desc: Remove Flux GitRepository and Kustomization for tier-1 and tier-2. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| requires: | ||
| vars: [KUBECTL_CMD] | ||
| cmds: | ||
| - "{{ .KUBECTL_CMD }} delete -f kubectl/flux-tier-1-tier-2.yaml --ignore-not-found" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| version: "3" | ||
|
|
||
| description: Taskfile for listing, exporting, and applying workload secrets. | ||
|
|
||
| includes: | ||
| tools: | ||
| taskfile: ./tools.yaml | ||
| internal: true | ||
|
|
||
| tasks: | ||
| list: | ||
| desc: List all secrets in tier-1, tier-2, and tier-3. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| cmds: | ||
| - "kubectl get secrets -n tier-1 -o wide" | ||
| - "kubectl get secrets -n tier-2 -o wide" | ||
| - "kubectl get secrets -n tier-3 -o wide" | ||
|
|
||
| export: | ||
| desc: Export required tier-1 and tier-2 secrets to kubectl/secrets.local.yaml. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| cmds: | ||
| - "kubectl get secret dice-java-openbao-token -n tier-1 -o yaml --show-managed-fields=false > kubectl/secrets.local.yaml" | ||
| - "echo --- >> kubectl/secrets.local.yaml" | ||
| - "kubectl get secret otel-otlp-client-auth -n tier-1 -o yaml --show-managed-fields=false >> kubectl/secrets.local.yaml" | ||
| - "echo --- >> kubectl/secrets.local.yaml" | ||
| - "kubectl get secret otel-otlp-ingest-htpasswd -n tier-2 -o yaml --show-managed-fields=false >> kubectl/secrets.local.yaml" | ||
| - "echo --- >> kubectl/secrets.local.yaml" | ||
| - "kubectl get secret opensearch-credentials -n tier-2 -o yaml --show-managed-fields=false >> kubectl/secrets.local.yaml" | ||
| - "echo --- >> kubectl/secrets.local.yaml" | ||
| - "kubectl get secret opensearch-ca-cert -n tier-2 -o yaml --show-managed-fields=false >> kubectl/secrets.local.yaml" | ||
|
|
||
| apply: | ||
| desc: Apply secrets from local file kubectl/secrets.local.yaml. | ||
| deps: | ||
| - task: tools:install-kubectl | ||
| preconditions: | ||
| - sh: 'test -f "kubectl/secrets.local.yaml"' | ||
| msg: "Missing kubectl/secrets.local.yaml. Run task secrets:export first." | ||
| cmds: | ||
| - "kubectl apply -f kubectl/secrets.local.yaml" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the idea behind this? I'm a bit concerned about direct commits... I normally prefer
peter-evans/create-pull-requestinstead