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 #119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
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
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
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
86de14c
Merge remote-tracking branch 'common-upstream/main' into common-autom…
mbaldessari May 30, 2024
28d9b49
Update tests after common rebase
mbaldessari May 30, 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
9 changes: 5 additions & 4 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,7 +32,7 @@ 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}}` }}'
Expand Down Expand Up @@ -67,5 +68,5 @@ spec:
operator: NotIn
values:
- 'true'
{{ end }}

{{- end }}
{{- end }}
11 changes: 10 additions & 1 deletion common/acm/templates/policies/application-policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ spec:
path: {{ default "common/clustergroup" .path }}
helm:
ignoreMissingValueFiles: true
values: |
extraParametersNested:
{{- range $k, $v := $.Values.extraParametersNested }}
{{ $k }}: {{ printf "%s" $v | quote }}
{{- end }}
valueFiles:
{{- include "acm.app.policies.valuefiles" . | nindent 22 }}
{{- range $valueFile := $.Values.global.extraValueFiles }}
{{- range $valueFile := .extraValueFiles }}
- {{ $valueFile | quote }}
{{- end }}
parameters:
Expand Down Expand Up @@ -73,6 +78,10 @@ spec:
value: {{ $group.name }}
- name: global.experimentalCapabilities
value: {{ $.Values.global.experimentalCapabilities }}
{{- range $k, $v := $.Values.extraParametersNested }}
- name: {{ $k }}
value: {{ printf "%s" $v | quote }}
{{- end }}
{{- range .helmOverrides }}
- name: {{ .name }}
value: {{ .value | quote }}
Expand Down
7 changes: 6 additions & 1 deletion common/acm/templates/policies/ocp-gitops-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ spec:
- -c
- cat /var/run/kube-root-ca/ca.crt /var/run/trusted-ca/ca-bundle.crt > /tmp/ca-bundles/ca-bundle.crt
|| true
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
image: registry.redhat.io/ubi9/ubi-minimal:latest
name: fetch-ca
resources: {}
volumeMounts:
Expand Down Expand Up @@ -195,6 +195,11 @@ spec:
memory: 128Mi
route:
enabled: true
{{- if and (.Values.global.argocdServer) (.Values.global.argocdServer.route) (.Values.global.argocdServer.route.tls) }}
tls:
insecureEdgeTerminationPolicy: {{ default "Redirect" .Values.global.argocdServer.route.tls.insecureEdgeTerminationPolicy }}
termination: {{ default "reencrypt" .Values.global.argocdServer.route.tls.termination }}
{{- end }}
service:
type: ""
sso:
Expand Down
2 changes: 2 additions & 0 deletions common/acm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ global:
targetRevision: main
options:
applicationRetryLimit: 20
secretStore:
backend: "vault"

clusterGroup:
subscriptions:
Expand Down
13 changes: 9 additions & 4 deletions common/ansible/roles/iib_ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ make EXTRA_HELM_OPTS="--set main.gitops.operatorSource=iib-${IIB} --set main.git
The advanced-cluster-management operator is a little bit more complex than the others because it
also installes another operator called MCE multicluster-engine. So to install ACM you typically
need two IIBs (one for acm and one for mce). With those two at hand, do the following (the ordering must be
consistent: the first IIB corresponds to the first OPERATOR, etc).
consistent: the first IIB corresponds to the first OPERATOR, etc). The following operation needs to be done
on both hub *and* spokes:

```sh
export OPERATOR=advanced-cluster-management,multicluster-engine
export INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:713808,registry-proxy.engineering.redhat.com/rh-osbs/iib:718034
make load-iib
for i in hub-kubeconfig-file spoke-kubeconfig-file; do
export KUBECONFIG="${i}"
export KUBEADMINPASS="11111-22222-33333-44444"
export OPERATOR=advanced-cluster-management,multicluster-engine
export INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:713808,registry-proxy.engineering.redhat.com/rh-osbs/iib:718034
make load-iib
done
```

Once the IIBs are loaded into the cluster we need to run the following steps:
Expand Down
3 changes: 3 additions & 0 deletions common/ansible/roles/iib_ci/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
ansible.builtin.shell: |
oc get openshiftcontrollermanager/cluster -o yaml -o jsonpath='{.status.version}'
register: oc_version_raw
retries: 10
delay: 10
until: oc_version_raw is not failed
changed_when: false

- name: Is OCP pre OCP 4.13? (aka registry supports v2 manifests)
Expand Down
16 changes: 16 additions & 0 deletions common/clustergroup/templates/imperative/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -18,4 +19,19 @@ rules:
- list
- watch
{{- end }}
{{- end }} {{/* if $.Values.clusterGroup.imperative.serviceAccountCreate */}}
{{- if $.Values.clusterGroup.imperative.adminServiceAccountCreate }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ $.Values.clusterGroup.imperative.adminClusterRoleName }}
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
{{- end }} {{/* if $.Values.clusterGroup.imperative.adminServiceAccountCreate */}}
{{- end }}
21 changes: 19 additions & 2 deletions common/clustergroup/templates/imperative/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate -}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $.Values.clusterGroup.imperative.namespace }}-cluster-admin-rolebinding
name: {{ $.Values.clusterGroup.imperative.namespace }}-cluster-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -17,7 +18,7 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $.Values.clusterGroup.imperative.namespace }}-admin-rolebinding
name: {{ $.Values.clusterGroup.imperative.namespace }}-rolebinding
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -28,3 +29,19 @@ subjects:
name: {{ $.Values.clusterGroup.imperative.serviceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- if $.Values.clusterGroup.imperative.adminServiceAccountCreate }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $.Values.clusterGroup.imperative.namespace }}-admin-clusterrolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ $.Values.clusterGroup.imperative.adminClusterRoleName }}
subjects:
- kind: ServiceAccount
name: {{ $.Values.clusterGroup.imperative.adminServiceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- end }}
10 changes: 9 additions & 1 deletion common/clustergroup/templates/imperative/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{{- if not (eq .Values.enabled "plumbing") }}
{{/* This is always defined as we always unseal the cluster with an imperative job */}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate -}}
{{- if $.Values.clusterGroup.imperative.serviceAccountCreate }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $.Values.clusterGroup.imperative.serviceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- if $.Values.clusterGroup.imperative.adminServiceAccountCreate }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $.Values.clusterGroup.imperative.adminServiceAccountName }}
namespace: {{ $.Values.clusterGroup.imperative.namespace }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions common/clustergroup/templates/plumbing/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ spec:
{{- else }}
helm:
ignoreMissingValueFiles: true
values: |
extraParametersNested:
{{- range $k, $v := $.Values.extraParametersNested }}
{{ $k }}: {{ printf "%s" $v | quote }}
{{- end }}
valueFiles:
{{- include "clustergroup.app.globalvalues.prefixedvaluefiles" $ | nindent 8 }}
{{- range $valueFile := $.Values.clusterGroup.sharedValueFiles }}
Expand Down Expand Up @@ -216,6 +221,11 @@ spec:
{{- else if not .kustomize }}
helm:
ignoreMissingValueFiles: true
values: |
extraParametersNested:
{{- range $k, $v := $.Values.extraParametersNested }}
{{ $k }}: {{ printf "%s" $v | quote }}
{{- end }}
valueFiles:
{{- include "clustergroup.app.globalvalues.valuefiles" $ | nindent 6 }}
{{- range $valueFile := $.Values.clusterGroup.sharedValueFiles }}
Expand Down
8 changes: 8 additions & 0 deletions common/clustergroup/templates/plumbing/argocd-super-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: openshift-gitops-cluster-admin-rolebinding
# We need to have this before anything else or the sync might get stuck forever
# due to permission issues
annotations:
argocd.argoproj.io/sync-wave: "-100"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -22,6 +26,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $.Values.global.pattern }}-{{ .Values.clusterGroup.name }}-cluster-admin-rolebinding
# We need to have this before anything else or the sync might get stuck forever
# due to permission issues
annotations:
argocd.argoproj.io/sync-wave: "-100"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
13 changes: 13 additions & 0 deletions common/clustergroup/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
"clusterGroupName": {
"type": "string"
},
"extraParameters": {
"type": "array",
"description": "Pass in extra Helm parameters to all ArgoCD Applications and the framework."
},
"experimentalCapabilities": {
"type": "string",
"description": "String to enable certain experimental capabilities in the operator and the framework."
Expand Down Expand Up @@ -677,6 +681,15 @@
},
"roleYaml": {
"type": "string"
},
"adminServiceAccountCreate": {
"type": "boolean"
},
"adminServiceAccountName": {
"type": "string"
},
"adminClusterRoleName": {
"type": "string"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions common/clustergroup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ clusterGroup:
clusterRoleYaml: ""
roleName: imperative-role
roleYaml: ""
adminServiceAccountCreate: true
adminServiceAccountName: imperative-admin-sa
adminClusterRoleName: imperative-admin-cluster-role

managedClusterGroups: {}
namespaces: []
# - name: factory
Expand Down
2 changes: 1 addition & 1 deletion common/golang-external-secrets/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ name: golang-external-secrets
version: 0.0.3
dependencies:
- name: external-secrets
version: "0.9.16"
version: "0.9.18"
repository: "https://charts.external-secrets.io"
#"https://external-secrets.github.io/kubernetes-external-secrets"
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions common/golang-external-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ golangExternalSecrets:
type: Secret
name: hub-ca
key: hub-kube-root-ca.crt
namespace: imperative
namespace: golang-external-secrets

global:
hubClusterDomain: hub.example.com
Expand All @@ -37,10 +37,10 @@ clusterGroup:

external-secrets:
image:
tag: v0.9.16-ubi
tag: v0.9.18-ubi
webhook:
image:
tag: v0.9.16-ubi
tag: v0.9.18-ubi
certController:
image:
tag: v0.9.16-ubi
tag: v0.9.18-ubi
2 changes: 1 addition & 1 deletion common/hashicorp-vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ vault:
termination: "reencrypt"
image:
repository: "registry.connect.redhat.com/hashicorp/vault"
tag: "1.16.1-ubi"
tag: "1.16.2-ubi"
3 changes: 0 additions & 3 deletions common/operator-install/templates/pattern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ spec:
tokenSecret: {{ .Values.main.tokenSecret }}
tokenSecretNamespace: {{ .Values.main.tokenSecretNamespace }}
{{- end }} {{/* if and .Values.main.tokenSecret .Values.main.tokenSecretNamespace */}}
gitOpsSpec:
operatorChannel: {{ default "gitops-1.12" .Values.main.gitops.channel }}
operatorSource: {{ default "redhat-operators" .Values.main.gitops.operatorSource }}
multiSourceConfig:
enabled: {{ .Values.main.multiSourceConfig.enabled }}
{{- if .Values.main.analyticsUUID }}
Expand Down
7 changes: 5 additions & 2 deletions common/operator-install/templates/subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ metadata:
operators.coreos.com/patterns-operator.openshift-operators: ""
spec:
channel: {{ .Values.main.patternsOperator.channel }}
installPlanApproval: Automatic
installPlanApproval: {{ .Values.main.patternsOperator.installPlanApproval }}
name: patterns-operator
source: {{ .Values.main.patternsOperator.source }}
sourceNamespace: openshift-marketplace
sourceNamespace: {{ .Values.main.patternsOperator.sourceNamespace }}
{{- if .Values.main.patternsOperator.startingCSV }}
startingCSV: {{ .Values.main.patternsOperator.startingCSV }}
{{- end }}
3 changes: 3 additions & 0 deletions common/operator-install/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ main:
patternsOperator:
channel: fast
source: community-operators
installPlanApproval: Automatic
sourceNamespace: openshift-marketplace
startingCSV: null

clusterGroupName: default

Expand Down
4 changes: 3 additions & 1 deletion common/tests/acm-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ 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}}'
Expand Down Expand Up @@ -214,6 +214,8 @@ spec:
path: common/clustergroup
helm:
ignoreMissingValueFiles: true
values: |
extraParametersNested:
valueFiles:
- "/values-global.yaml"
- "/values-factory.yaml"
Expand Down
4 changes: 3 additions & 1 deletion common/tests/acm-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ 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}}'
Expand Down Expand Up @@ -205,6 +205,8 @@ spec:
path: common/clustergroup
helm:
ignoreMissingValueFiles: true
values: |
extraParametersNested:
valueFiles:
- "/values-global.yaml"
- "/values-region-one.yaml"
Expand Down
Loading