Skip to content

Commit

Permalink
Merge pull request #119 from mbaldessari/common-automatic-update
Browse files Browse the repository at this point in the history
common automatic update
  • Loading branch information
mbaldessari authored May 30, 2024
2 parents 7290cc2 + 28d9b49 commit 5c2381f
Show file tree
Hide file tree
Showing 67 changed files with 1,754 additions and 672 deletions.
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

0 comments on commit 5c2381f

Please sign in to comment.