Skip to content

Commit 5841768

Browse files
lcarvaRoming22
authored andcommitted
Remove usage of chains-ca-cert
The chains-ca-cert ConfigMap was introduced in order to allow the Tekton Chains controller to push content to the integrated OpenShift registry. Since then, we have moved away from using this registry altogether in favor of quay.io. This change removes usage of the chains-ca-cert ConfigMap as well as the ArgoCD Jobs responsible for setting it up. #673 Signed-off-by: Luiz Carvalho <[email protected]>
1 parent a238e40 commit 5841768

File tree

2 files changed

+2
-97
lines changed

2 files changed

+2
-97
lines changed

operator/gitops/argocd/pipeline-service/tekton-chains/chains-controller-deployment.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
########################
3-
# Mount the secrets volume where chains CA cert is located
4-
########################
5-
# Apply operator security standards (drop capabilities, resourece limits, run as non root, etc)
3+
# Apply operator security standards (drop capabilities, run as non root, etc)
64
########################
75
#
86
# The default install of chains includes the following
@@ -24,16 +22,12 @@ metadata:
2422
name: tekton-chains-controller
2523
namespace: tekton-chains
2624
annotations:
27-
argocd.argoproj.io/sync-wave: "3"
25+
argocd.argoproj.io/sync-wave: "2"
2826
spec:
2927
template:
3028
spec:
3129
containers:
3230
- name: tekton-chains-controller
33-
volumeMounts:
34-
# Mount the secrets volume
35-
- mountPath: /etc/ssl/certs
36-
name: chains-ca-cert
3731
securityContext:
3832
allowPrivilegeEscalation: false
3933
capabilities:
@@ -45,7 +39,3 @@ spec:
4539
seccompProfile:
4640
type: RuntimeDefault
4741
readOnlyRootFilesystem: true
48-
volumes:
49-
- name: chains-ca-cert
50-
secret:
51-
secretName: chains-ca-cert

operator/gitops/argocd/pipeline-service/tekton-chains/chains-secrets-config.yaml

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
---
22
apiVersion: v1
3-
kind: Secret
4-
metadata:
5-
name: chains-ca-cert
6-
namespace: tekton-chains
7-
type: Opaque
8-
---
9-
apiVersion: v1
103
kind: ServiceAccount
114
metadata:
125
name: chains-secrets-admin
@@ -22,7 +15,6 @@ rules:
2215
- ""
2316
resources:
2417
- secrets
25-
- configmaps
2618
verbs:
2719
- list
2820
- create
@@ -73,51 +65,6 @@ subjects:
7365
---
7466
apiVersion: batch/v1
7567
kind: Job
76-
metadata:
77-
name: chains-certs-configuration
78-
namespace: tekton-chains
79-
annotations:
80-
argocd.argoproj.io/sync-wave: "2"
81-
spec:
82-
template:
83-
spec:
84-
containers:
85-
- image: registry.redhat.io/openshift4/ose-cli:v4.12@sha256:9f0cdc00b1b1a3c17411e50653253b9f6bb5329ea4fb82ad983790a6dbf2d9ad
86-
command:
87-
- /bin/bash
88-
- -c
89-
- |
90-
echo "Waiting for secret and configmaps to be present"
91-
until oc get secret chains-ca-cert -n tekton-chains &&\
92-
oc get cm config-trusted-cabundle -n tekton-chains &&\
93-
oc get cm kube-root-ca.crt -n tekton-chains
94-
do
95-
sleep 5;
96-
done
97-
98-
# Update the chains-ca-cert secret with cluster certs, trusted-ca's and ingress cert.
99-
# The configmaps are injected by the Cluster Network Operator.
100-
# Once https://github.com/tektoncd/operator/pull/648 changes are released, we can remove/review this hook.
101-
echo "Build the certificate and replace secret/chains-ca-cert"
102-
TRUSTED_CA=$(mktemp)
103-
KUBE_CA=$(mktemp)
104-
INGRESS_CA=$(mktemp)
105-
oc get cm config-trusted-cabundle -n tekton-chains -o jsonpath="{.data.ca-bundle\.crt}" > $TRUSTED_CA
106-
oc get cm kube-root-ca.crt -n tekton-chains -o jsonpath="{.data.ca\.crt}" > $KUBE_CA
107-
oc get secret router-ca -n openshift-ingress-operator -o jsonpath="{.data.tls\.crt}" | base64 -d > $INGRESS_CA
108-
SERVICE_CA=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
109-
cat $TRUSTED_CA $KUBE_CA $INGRESS_CA $SERVICE_CA > /tmp/ca-certificates.crt
110-
oc create secret generic chains-ca-cert --from-file=/tmp/ca-certificates.crt --dry-run=client -o yaml -n tekton-chains | oc apply --force-conflicts --server-side=true -f -
111-
imagePullPolicy: Always
112-
name: patch-chains-certs
113-
dnsPolicy: ClusterFirst
114-
restartPolicy: OnFailure
115-
terminationGracePeriodSeconds: 30
116-
serviceAccount: chains-secrets-admin
117-
serviceAccountName: chains-secrets-admin
118-
---
119-
apiVersion: batch/v1
120-
kind: Job
12168
metadata:
12269
name: tekton-chains-signing-secret
12370
namespace: tekton-chains
@@ -161,35 +108,3 @@ spec:
161108
terminationGracePeriodSeconds: 30
162109
serviceAccount: chains-secrets-admin
163110
serviceAccountName: chains-secrets-admin
164-
---
165-
apiVersion: batch/v1
166-
kind: Job
167-
metadata:
168-
name: tekton-chains-trusted-cabundle
169-
namespace: tekton-chains
170-
annotations:
171-
argocd.argoproj.io/sync-wave: "1"
172-
spec:
173-
template:
174-
spec:
175-
containers:
176-
- name: config-trusted-cabundle-generation
177-
image: registry.redhat.io/openshift4/ose-cli:v4.12@sha256:9f0cdc00b1b1a3c17411e50653253b9f6bb5329ea4fb82ad983790a6dbf2d9ad
178-
imagePullPolicy: Always
179-
command:
180-
- /bin/bash
181-
- -c
182-
- |
183-
if oc get cm config-trusted-cabundle -n tekton-chains; then
184-
echo "ConfigMap config-trusted-cabundle found"
185-
else
186-
echo "Create ConfigMap config-trusted-cabundle"
187-
oc create configmap config-trusted-cabundle --namespace tekton-chains
188-
oc label configmap config-trusted-cabundle config.openshift.io/inject-trusted-cabundle="true"
189-
fi
190-
echo "Done"
191-
dnsPolicy: ClusterFirst
192-
restartPolicy: OnFailure
193-
terminationGracePeriodSeconds: 30
194-
serviceAccount: chains-secrets-admin
195-
serviceAccountName: chains-secrets-admin

0 commit comments

Comments
 (0)