Skip to content
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

common automatic update #38

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
f2215f7
feat: add support for hive clusterdeployments creating spokes
TomerFi Apr 16, 2024
f9bf1f7
test: regenerated tests after clusterdeployment commit
TomerFi Apr 16, 2024
5b4e903
test: updated test-cased and regeneated expectations
TomerFi Apr 17, 2024
a073b8c
chore: added annotations controling gitops and fail for missing meta …
TomerFi Apr 23, 2024
c6ffd0e
chore: removed managedclusterset spec
TomerFi Apr 26, 2024
ff3147a
New global scope argocdServer section for values-global.yaml
claudiol May 2, 2024
aa0b969
Improve readme for ACM IIB
mbaldessari May 3, 2024
35db672
Merge pull request #500 from mbaldessari/iib-acm
mbaldessari May 3, 2024
0fdc074
Merge pull request #499 from claudiol/argocd-tls-redirect
mbaldessari May 3, 2024
23614a4
Drop gitopsspec from pattern's CR
mbaldessari May 3, 2024
d9c7350
Allow customizing the VP operator subscription
mbaldessari May 3, 2024
6cf424f
Merge pull request #501 from mbaldessari/operator-install
claudiol May 3, 2024
e5ad7af
Merge pull request #502 from mbaldessari/operator-install2
claudiol May 3, 2024
258af6b
Add retries when checking oc version
mbaldessari May 6, 2024
e9d1a4f
Merge pull request #504 from mbaldessari/retries-iib
mbaldessari May 6, 2024
1cbcc98
Add an imperative-admin-sa service account
mbaldessari Apr 23, 2024
370b78e
Merge pull request #492 from mbaldessari/imperative-admin
mbaldessari May 6, 2024
3a4eaf9
Added support to label/annotate nodes
soukron May 9, 2024
308d708
Added support to enable user workloads in control plane nodes
soukron May 9, 2024
0123fc7
Added full support for the scheduler
soukron May 9, 2024
48b584e
Simplified PR for auto approve install plans
soukron May 9, 2024
04a6d6d
Switch to registry.redhat.io for the initContainer image
mbaldessari May 13, 2024
502da98
Merge pull request #508 from mbaldessari/consistent-registry
mbaldessari May 13, 2024
f6c7a47
Update for ACM chart to application-policies.yaml
claudiol May 14, 2024
cea4fd6
Merge pull request #509 from claudiol/acm-application-policies-update
claudiol May 14, 2024
4d422a4
Add extraParameters to values.schema.json
claudiol May 15, 2024
b2a7085
Merge pull request #511 from claudiol/update-clustergroup-values-schema
claudiol May 15, 2024
ab630bb
Update ESO to 0.9.18
mbaldessari May 17, 2024
2638c41
Merge pull request #514 from mbaldessari/eso-0.9.18
mbaldessari May 17, 2024
7d147b2
Update vault to 1.16.2
mbaldessari May 17, 2024
4eeb69b
Feat: Followup to definition of extraParameters under the main sectio…
claudiol May 17, 2024
e23fea0
Use golang-external-secrets for the acm hub-ca bits
mbaldessari May 17, 2024
f673491
Only do the acm hub ca policy when vault is the backend
mbaldessari May 17, 2024
e1a448d
Merge pull request #516 from claudiol/extra-nested-params-updates
mbaldessari May 17, 2024
5341801
Merge pull request #518 from mbaldessari/new-ns-for-hub-ca
claudiol May 17, 2024
e3d6704
Merge pull request #520 from mbaldessari/new-vault
mbaldessari May 27, 2024
6cd4e85
fix: when using clusterdeployments, secrets should exist in the clust…
TomerFi May 28, 2024
ff40ddc
Force rolebindings as early as possible
mbaldessari May 30, 2024
528f1e6
Merge pull request #522 from mbaldessari/force-bindings-early
mbaldessari May 30, 2024
113a907
bug: Invalid OperatorGroup generated when ommitting targetNamespaces
claudiol May 29, 2024
e6441ce
Merge pull request #521 from claudiol/fix-targetns-operatorgroup
claudiol May 30, 2024
7ba9db5
Merge pull request #472 from TomerFi/add-clusterdeployments
mbaldessari May 30, 2024
ad87c84
Fix CI issue
mbaldessari May 30, 2024
e0f09a8
Merge pull request #523 from mbaldessari/ci-fix
mbaldessari May 30, 2024
dfe5b1a
Merge branch 'main' into feature/control-scheduler-for-masters
mbaldessari Jun 3, 2024
c799881
Merge pull request #505 from soukron/feature/control-scheduler-for-ma…
mbaldessari Jun 3, 2024
e3d4185
Merge pull request #507 from soukron/feature/auto-approve-installplans
mbaldessari Jun 3, 2024
beb71a1
Actually use adminServiceAccountName for the auto approve job
mbaldessari Jun 3, 2024
7606d1a
Merge pull request #525 from mbaldessari/imperative-admin-jobs
mbaldessari Jun 3, 2024
39addf2
Make sure that the if condition on chart split is not always true
mbaldessari Jun 4, 2024
6da9afa
Merge pull request #526 from mbaldessari/gh-fix1
mbaldessari Jun 4, 2024
10b0665
Bump super-linter from 5 to 6
mbaldessari Jun 4, 2024
c85ada6
Drop some validations for now
mbaldessari Jun 4, 2024
d923c3b
Merge pull request #527 from mbaldessari/superlinter6
mbaldessari Jun 4, 2024
a232db5
Add some debugging to the chart split action
mbaldessari Jun 4, 2024
6a39172
Merge pull request #528 from mbaldessari/gh-fix2
mbaldessari Jun 4, 2024
821727a
Use a specific git version when running git subtree split
mbaldessari Jun 4, 2024
8f787d9
Merge pull request #529 from mbaldessari/gh-fix3
mbaldessari Jun 4, 2024
3061644
Release clustergroup v0.8.6
mbaldessari Jun 4, 2024
2763a5f
Merge pull request #530 from mbaldessari/clustergroup-0.8.6
mbaldessari Jun 4, 2024
ae14cd2
Add a sudo to apt-get command
mbaldessari Jun 4, 2024
69063d1
Merge pull request #531 from mbaldessari/sudo
mbaldessari Jun 4, 2024
17325d6
Add some READMEs in the individual charts
mbaldessari Jun 6, 2024
5523097
Fix super-linter issues and upgrade local super-linter target
mbaldessari Jun 6, 2024
a450f5a
Merge pull request #532 from mbaldessari/READMEs
mbaldessari Jun 6, 2024
e3babbb
Skip unreachable spokes when setting up vault
mbaldessari Jun 6, 2024
15b92cf
Merge pull request #533 from mbaldessari/resilient-unseal
mbaldessari Jun 6, 2024
3ec1839
Add no_log to spokes initialization task
mbaldessari Jun 7, 2024
d1be1e4
Merge pull request #534 from mbaldessari/nolog-ansible2
mbaldessari Jun 7, 2024
9809c86
Drop initContainers variable and make it the default
mbaldessari Jun 6, 2024
75f8385
Update tests after dropping initContainers
mbaldessari Jun 7, 2024
56378d3
Merge pull request #535 from mbaldessari/dropinitcontainers
mbaldessari Jun 7, 2024
b489135
Release clustergroup v0.8.7
mbaldessari Jun 7, 2024
c04c68a
Merge pull request #536 from mbaldessari/newclustergroup
mbaldessari Jun 7, 2024
d846593
Upgrade ESO to v0.9.19
mbaldessari Jun 7, 2024
488fd39
Merge pull request #537 from mbaldessari/eso-0.9.19
mbaldessari Jun 7, 2024
b907bd5
Update helm version in CI to 3.14.0
mbaldessari Jun 7, 2024
5ffb4d3
Merge pull request #538 from mbaldessari/ci-helm-version
mbaldessari Jun 7, 2024
429f55c
Drop imperative.initcontainers.gitinit
mbaldessari Jun 10, 2024
e967b15
Have unseal work whenever we specifiy HEAD
mbaldessari Jun 10, 2024
32f3a93
Merge pull request #539 from mbaldessari/unseal-head
mbaldessari Jun 10, 2024
85c3a9b
make resourceExclusion configurable
strangiato Jun 5, 2024
05a876b
Update tests after upgrading resourceExclusions tweak
mbaldessari Jun 10, 2024
dc49d9d
Merge pull request #540 from mbaldessari/helathcheck-configurable
mbaldessari Jun 10, 2024
e97b2e7
Make resourcehealthchecks configurable
strangiato Jun 5, 2024
8d1aaab
Update tests after upgrading resourceHealthChecks change
mbaldessari Jun 10, 2024
63b85b2
Merge pull request #541 from mbaldessari/pr-2
mbaldessari Jun 10, 2024
32194d1
Do not quote $BRANCH variable
mbaldessari Jun 10, 2024
c06539f
Merge pull request #542 from mbaldessari/fix-unseal
mbaldessari Jun 10, 2024
97b2afa
Fix initcontainer race on spokes
mbaldessari Jun 10, 2024
42087ea
Merge pull request #543 from mbaldessari/fix-race2
mbaldessari Jun 10, 2024
ffa35ef
Release clustergroup v0.8.8
mbaldessari Jun 10, 2024
a110512
Merge pull request #544 from mbaldessari/clustergroup-0.8.8
mbaldessari Jun 10, 2024
e47dd3f
configure annotation based resource tracking
strangiato Jun 11, 2024
8f7e3b1
Merge pull request #545 from mbaldessari/pr-1
mbaldessari Jun 11, 2024
5b52f0d
Drop imperative.volumes and imperative.volumemounts
mbaldessari Jun 15, 2024
8242abd
Merge pull request #546 from mbaldessari/cleanup1
mbaldessari Jun 15, 2024
28b2d39
Properly quote vault kv command
mbaldessari Jun 18, 2024
6a312d7
Make HUB work when spokes point to in hub cluster gitea
mbaldessari Jun 11, 2024
591a339
update tests
mbaldessari Jun 18, 2024
324a8a2
Merge pull request #548 from mbaldessari/spoke-ca-gitea
mbaldessari Jun 18, 2024
49f75ec
Merge pull request #547 from mbaldessari/password-dollar
mbaldessari Jun 19, 2024
de5647f
ACM chart version 0.0.2
mbaldessari Jun 24, 2024
1fa5746
golang-external-secrets chart version 0.0.4
mbaldessari Jun 24, 2024
89b499b
hashicorp-vault chart version 0.0.2
mbaldessari Jun 24, 2024
ba674d9
Merge pull request #549 from mbaldessari/multi-source
mbaldessari Jun 24, 2024
89a4cad
Implement multi-source
mbaldessari Jun 24, 2024
2e78669
Add tests for proper multisource support on spokes
mbaldessari Jun 29, 2024
b4574ed
Merge pull request #550 from mbaldessari/multisource-new
mbaldessari Jun 29, 2024
9a3aa2b
Release clustergroup v0.8.9
mbaldessari Jun 29, 2024
e67a770
Merge pull request #551 from mbaldessari/clustergroup-0.8.9
mbaldessari Jun 29, 2024
13f3b23
Fix multisource indent error
mbaldessari Jun 29, 2024
ac6640c
Release clustergroup v0.8.10
mbaldessari Jun 29, 2024
fc92a78
Merge pull request #552 from mbaldessari/clustergroup-0.8.10
mbaldessari Jun 29, 2024
5f678b5
Release acm v0.0.3
mbaldessari Jun 29, 2024
2ce3808
Merge pull request #553 from mbaldessari/acm-0.0.3
mbaldessari Jun 29, 2024
ca9e3a2
Fix missing chart field
mbaldessari Jun 29, 2024
95bae32
Merge pull request #554 from mbaldessari/small-multisource-fix
mbaldessari Jun 29, 2024
5bdeff5
Release acm v0.0.4
mbaldessari Jul 9, 2024
98cbcab
Merge pull request #555 from mbaldessari/acm-0.0.4
mbaldessari Jul 9, 2024
bf0c8aa
Update chart versions
mbaldessari Jul 9, 2024
88ab5b3
Merge pull request #556 from mbaldessari/update-chart-versions
mbaldessari Jul 9, 2024
fc675e5
Update vault-helm to v0.28.1 and vault to 1.17.2
mbaldessari Jul 15, 2024
d83b201
Merge pull request #557 from mbaldessari/vault-helm-0.28.1
mbaldessari Jul 15, 2024
0b45eea
Update ESO to 0.9.20
mbaldessari Jul 15, 2024
6b426aa
Merge pull request #558 from mbaldessari/eso-0.9.20
mbaldessari Jul 15, 2024
b71cb0f
Release new hashicorp-vault and golang-external-secrets charts
mbaldessari Jul 15, 2024
912b510
Merge pull request #559 from mbaldessari/new-charts
mbaldessari Jul 15, 2024
0983d0d
Add Ansible playbook
Jul 19, 2024
4ce4d80
Put the playbook in a more normal location for us
Jul 19, 2024
41bc42d
Exclude new playbook
Jul 19, 2024
7bcfbd3
Allow for choice in where file is written
Jul 26, 2024
9a3c487
Merge pull request #561 from mhjacks/provide_kubeconfig_writer
mhjacks Jul 29, 2024
1f08dfe
Merge pull request #506 from soukron/feature/add-labels-to-nodes
mhjacks Jul 31, 2024
98d4312
Fix pki bind mount when using podman machine
mbaldessari Aug 6, 2024
414a252
Merge pull request #562 from mbaldessari/fix-macosx
mbaldessari Aug 6, 2024
7259ee0
Merge remote-tracking branch 'common-upstream/main' into common-autom…
mbaldessari Aug 6, 2024
7277ddf
Update tests after common rebase
mbaldessari Aug 6, 2024
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
1 change: 1 addition & 0 deletions common/.ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ exclude_paths:
- ./ansible/playbooks/iib-ci/iib-ci.yaml
- ./ansible/playbooks/k8s_secrets/k8s_secrets.yml
- ./ansible/playbooks/process_secrets/process_secrets.yml
- ./ansible/playbooks/write-token-kubeconfig/write-token-kubeconfig.yml
- ./ansible/playbooks/process_secrets/display_secrets_info.yml
- ./ansible/roles/vault_utils/tests/test.yml
20 changes: 5 additions & 15 deletions common/.github/workflows/chart-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:

acm:
needs: changes
if: |
${{ needs.changes.outputs.acm == 'true' }} &&
github.repository == 'validatedpatterns/common'
if: ${{ (needs.changes.outputs.acm == 'true') && (github.repository == 'validatedpatterns/common') }}
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
permissions:
actions: write
Expand All @@ -63,9 +61,7 @@ jobs:

golang-external-secrets:
needs: changes
if: |
${{ needs.changes.outputs.golang-external-secrets == 'true' }} &&
github.repository == 'validatedpatterns/common'
if: ${{ (needs.changes.outputs.golang-external-secrets == 'true') && (github.repository == 'validatedpatterns/common') }}
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
permissions:
actions: write
Expand All @@ -77,9 +73,7 @@ jobs:

hashicorp-vault:
needs: changes
if: |
${{ needs.changes.outputs.hashicorp-vault == 'true' }} &&
github.repository == 'validatedpatterns/common'
if: ${{ (needs.changes.outputs.hashicorp-vault == 'true') && (github.repository == 'validatedpatterns/common') }}
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
permissions:
actions: write
Expand All @@ -91,9 +85,7 @@ jobs:

letsencrypt:
needs: changes
if: |
${{ needs.changes.outputs.letsencrypt == 'true' }} &&
github.repository == 'validatedpatterns/common'
if: ${{ (needs.changes.outputs.letsencrypt == 'true') && (github.repository == 'validatedpatterns/common') }}
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
permissions:
actions: write
Expand All @@ -105,9 +97,7 @@ jobs:

clustergroup:
needs: changes
if: |
${{ needs.changes.outputs.clustergroup == 'true' }} &&
github.repository == 'validatedpatterns/common'
if: ${{ (needs.changes.outputs.clustergroup == 'true') && (github.repository == 'validatedpatterns/common') }}
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
permissions:
actions: write
Expand Down
8 changes: 6 additions & 2 deletions common/.github/workflows/chart-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ jobs:
set -e
N="${{ inputs.chart_name }}"
B="${N}-main-single-chart"
GITIMG="quay.io/hybridcloudpatterns/gitsubtree-container:2.40.1"
sudo apt-get update -y && sudo apt-get install -y podman
echo "Running subtree split for ${B}"
podman pull "${GITIMG}"
git push origin -d "${B}" || /bin/true
git subtree split -P "${N}" -b "${B}"
git push -f -u origin "${B}"
# Git subtree got broken on recent versions of git hence this container
podman run --net=host --rm -t -v .:/git "${GITIMG}" subtree split -P "${N}" -b "${B}"
#git clone https://validatedpatterns:${GITHUB_TOKEN}@github.com/validatedpatterns/common.git -b "acm-main-single-chart" --single-branch
git push --force https://validatedpatterns:"${GITHUB_TOKEN}"@github.com/${{ inputs.target_repository }}.git "${B}:main"
2 changes: 1 addition & 1 deletion common/.github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup helm
uses: azure/setup-helm@v4
with:
version: 'v3.13.2'
version: 'v3.14.0'


################################
Expand Down
5 changes: 4 additions & 1 deletion common/.github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter/slim@v5
uses: github/super-linter/slim@v6
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# These are the validation we disable atm
VALIDATE_ANSIBLE: false
VALIDATE_BASH: false
VALIDATE_CHECKOV: false
VALIDATE_JSCPD: false
VALIDATE_KUBERNETES_KUBECONFORM: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_SHELL_SHFMT: false
VALIDATE_YAML: false
# VALIDATE_DOCKERFILE_HADOLINT: false
# VALIDATE_MARKDOWN: false
Expand Down
14 changes: 10 additions & 4 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ load-iib: ## CI target to install Index Image Bundles
exit 1; \
fi

.PHONY: token-kubeconfig
token-kubeconfig: ## Create a local ~/.kube/config with password (not usually needed)
common/scripts/write-token-kubeconfig.sh

##@ Validation Tasks

Expand Down Expand Up @@ -230,17 +233,20 @@ kubeconform: ## run helm kubeconform
super-linter: ## Runs super linter locally
rm -rf .mypy_cache
podman run -e RUN_LOCAL=true -e USE_FIND_ALGORITHM=true \
-e VALIDATE_ANSIBLE=false \
-e VALIDATE_BASH=false \
-e VALIDATE_CHECKOV=false \
-e VALIDATE_DOCKERFILE_HADOLINT=false \
-e VALIDATE_JSCPD=false \
-e VALIDATE_KUBERNETES_KUBECONFORM=false \
-e VALIDATE_YAML=false \
-e VALIDATE_ANSIBLE=false \
-e VALIDATE_DOCKERFILE_HADOLINT=false \
-e VALIDATE_PYTHON_PYLINT=false \
-e VALIDATE_SHELL_SHFMT=false \
-e VALIDATE_TEKTON=false \
-e VALIDATE_YAML=false \
$(DISABLE_LINTERS) \
-v $(PWD):/tmp/lint:rw,z \
-w /tmp/lint \
docker.io/github/super-linter:slim-v5
ghcr.io/super-linter/super-linter:slim-v6

.PHONY: ansible-lint
ansible-lint: ## run ansible lint on ansible/ folder
Expand Down
2 changes: 1 addition & 1 deletion common/acm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: A Helm chart to configure Advanced Cluster Manager for OpenShift.
keywords:
- pattern
name: acm
version: 0.0.1
version: 0.1.0
5 changes: 5 additions & 0 deletions common/acm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Validated Patterns ACM chart

This chart is used to set up ACM in [Validated Patterns](https://validatedpatterns.io)

Please send PRs [here](https://github.com/validatedpatterns/common)
44 changes: 44 additions & 0 deletions common/acm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,47 @@ Default always defined valueFiles to be included when pushing the cluster wide a
# hub's cluster version, whereas we want to include the spoke cluster version
- '/values-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
{{- end }} {{- /*acm.app.policies.valuefiles */}}

{{- define "acm.app.policies.multisourcevaluefiles" -}}
- "$patternref/values-global.yaml"
- "$patternref/values-{{ .name }}.yaml"
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}.yaml'
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ .name }}.yaml'
# We cannot use $.Values.global.clusterVersion because that gets resolved to the
# hub's cluster version, whereas we want to include the spoke cluster version
- '$patternref/values-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
{{- end }} {{- /*acm.app.policies.multisourcevaluefiles */}}

{{- define "acm.app.policies.helmparameters" -}}
- name: global.repoURL
value: {{ $.Values.global.repoURL }}
- name: global.targetRevision
value: {{ $.Values.global.targetRevision }}
- name: global.namespace
value: $ARGOCD_APP_NAMESPACE
- name: global.pattern
value: {{ $.Values.global.pattern }}
- name: global.hubClusterDomain
value: {{ $.Values.global.hubClusterDomain }}
- name: global.localClusterDomain
value: '{{ `{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain }}` }}'
- name: global.clusterDomain
value: '{{ `{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain | replace "apps." "" }}` }}'
- name: global.clusterVersion
value: '{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}'
- name: global.localClusterName
value: '{{ `{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}` }}'
- name: global.clusterPlatform
value: {{ $.Values.global.clusterPlatform }}
- name: global.multiSourceSupport
value: {{ $.Values.global.multiSourceSupport | quote }}
- name: global.multiSourceRepoUrl
value: {{ $.Values.global.multiSourceRepoUrl }}
- name: global.multiSourceTargetRevision
value: {{ $.Values.global.multiSourceTargetRevision }}
- name: global.privateRepo
value: {{ $.Values.global.privateRepo | quote }}
- name: global.experimentalCapabilities
value: {{ $.Values.global.experimentalCapabilities }}
{{- end }} {{- /*acm.app.policies.helmparameters */}}
161 changes: 158 additions & 3 deletions common/acm/templates/policies/acm-hub-ca-policy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This pushes out the HUB's Certificate Authorities on to the imported clusters
{{ if .Values.clusterGroup.isHubCluster }}
{{- if .Values.clusterGroup.isHubCluster }}
{{- if (eq (((.Values.global).secretStore).backend) "vault") }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
Expand Down Expand Up @@ -31,10 +32,22 @@ spec:
type: Opaque
metadata:
name: hub-ca
namespace: imperative
namespace: golang-external-secrets
data:
hub-kube-root-ca.crt: '{{ `{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | base64enc hub}}` }}'
hub-openshift-service-ca.crt: '{{ `{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | base64enc hub}}` }}'
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-hub-bundle
namespace: imperative
data:
hub-kube-root-ca.crt: |
{{ `{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | autoindent hub}}` }}
hub-openshift-service-ca.crt: |
{{ `{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | autoindent hub}}` }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
Expand Down Expand Up @@ -67,5 +80,147 @@ spec:
operator: NotIn
values:
- 'true'
{{ end }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: hub-argo-ca-openshift-gitops-policy
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
remediationAction: enforce
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: hub-argo-ca-openshift-gitops-config
spec:
remediationAction: enforce
severity: medium
namespaceSelector:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-hub-bundle
namespace: openshift-gitops
data:
hub-kube-root-ca.crt: |
{{ `{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | autoindent hub}}` }}
hub-openshift-service-ca.crt: |
{{ `{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | autoindent hub}}` }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: hub-argo-ca-openshift-gitops-policy-binding
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: hub-argo-ca-openshift-gitops-policy-placement
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: hub-argo-ca-openshift-gitops-policy
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: hub-argo-ca-openshift-gitops-policy-placement
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: local-cluster
operator: NotIn
values:
- 'true'

{{- end }}{{/* if (eq (((.Values.global).secretStore).backend) "vault") */}}
{{- range .Values.clusterGroup.managedClusterGroups }}
{{- $group := . }}
{{- if not .hostedArgoSites }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: hub-argo-ca-{{ .name }}-policy
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
remediationAction: enforce
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: hub-argo-ca-{{ .name }}-config
spec:
remediationAction: enforce
severity: medium
namespaceSelector:
include:
- default
object-templates:
- complianceType: mustonlyhave
objectDefinition:
kind: ConfigMap
apiVersion: v1
metadata:
name: trusted-hub-bundle
namespace: {{ $.Values.global.pattern }}-{{ .name }}
data:
hub-kube-root-ca.crt: |
{{ `{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | autoindent hub}}` }}
hub-openshift-service-ca.crt: |
{{ `{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | autoindent hub}}` }}
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: hub-argo-ca-{{ .name }}-placement-binding
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
placementRef:
name: hub-argo-ca-{{ .name }}-placement
kind: PlacementRule
apiGroup: apps.open-cluster-management.io
subjects:
- name: hub-argo-ca-{{ .name }}-policy
kind: Policy
apiGroup: policy.open-cluster-management.io
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
name: hub-argo-ca-{{ .name }}-placement
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
clusterConditions:
- status: 'True'
type: ManagedClusterConditionAvailable
clusterSelector:
matchExpressions:
- key: local-cluster
operator: NotIn
values:
- 'true'
{{- end }}{{/* if not .hostedArgoSites */}}
{{- end }}{{/* range .Values.clusterGroup.managedClusterGroups */}}
{{- end }}{{/* isHubCluster */}}
Loading
Loading