Skip to content

Commit a97b9b6

Browse files
Satyam BhardwajRoming22
authored andcommitted
remove references to chains ns
- The tekton-chains namespace is obsolete with the Tekton-Chains controller deployed with openshift-pipelines operator. - We also don't need the secrets-migrator because 'chains-secret-admin' now directly create/update the secretes in the Openshift-Pipelines namespace. - remove redundant roles & RB for `chains-secrets-admin` SA from openshift-ingress-operator namespace Signed-off-by: Satyam Bhardwaj <[email protected]>
1 parent 573268b commit a97b9b6

File tree

12 files changed

+50
-301
lines changed

12 files changed

+50
-301
lines changed

operator/gitops/argocd/pipeline-service/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ kind: Kustomization
44

55
resources:
66
- openshift-pipelines
7-
- tekton-chains
87
- tekton-results
98
- metrics-exporter
109

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: openshift-gitops-jobs-admin
6+
annotations:
7+
argocd.argoproj.io/sync-wave: "0"
8+
rules:
9+
- apiGroups:
10+
- batch
11+
resources:
12+
- jobs
13+
verbs:
14+
- get
15+
- list
16+
- patch
17+
- create
18+
- delete
19+
---
20+
apiVersion: rbac.authorization.k8s.io/v1
21+
kind: ClusterRoleBinding
22+
metadata:
23+
name: openshift-gitops-jobs-admin
24+
annotations:
25+
argocd.argoproj.io/sync-wave: "0"
26+
roleRef:
27+
apiGroup: rbac.authorization.k8s.io
28+
kind: ClusterRole
29+
name: openshift-gitops-jobs-admin
30+
subjects:
31+
- kind: ServiceAccount
32+
name: openshift-gitops-argocd-application-controller
33+
namespace: openshift-gitops

operator/gitops/argocd/pipeline-service/tekton-chains/public-key.yaml renamed to operator/gitops/argocd/pipeline-service/openshift-pipelines/chains-public-key-viewer.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ rules:
1717
- list
1818
- watch
1919
---
20+
# public-key access
2021
apiVersion: rbac.authorization.k8s.io/v1
2122
kind: RoleBinding
2223
metadata:
2324
name: tekton-chains-public-key-viewer
24-
namespace: tekton-chains
25+
namespace: openshift-pipelines
2526
annotations:
2627
argocd.argoproj.io/sync-wave: "0"
2728
roleRef:

operator/gitops/argocd/pipeline-service/tekton-chains/chains-secrets-config.yaml renamed to operator/gitops/argocd/pipeline-service/openshift-pipelines/chains-secrets-config.yaml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ apiVersion: v1
33
kind: ServiceAccount
44
metadata:
55
name: chains-secrets-admin
6-
namespace: tekton-chains
6+
namespace: openshift-pipelines
77
annotations:
88
argocd.argoproj.io/sync-wave: "0"
99
---
1010
apiVersion: rbac.authorization.k8s.io/v1
1111
kind: Role
1212
metadata:
1313
name: chains-secret-admin
14-
namespace: tekton-chains
14+
namespace: openshift-pipelines
1515
annotations:
1616
argocd.argoproj.io/sync-wave: "0"
1717
rules:
@@ -27,25 +27,10 @@ rules:
2727
- patch
2828
---
2929
apiVersion: rbac.authorization.k8s.io/v1
30-
kind: Role
31-
metadata:
32-
name: secret-reader
33-
namespace: openshift-ingress-operator
34-
annotations:
35-
argocd.argoproj.io/sync-wave: "0"
36-
rules:
37-
- apiGroups:
38-
- ""
39-
resources:
40-
- secrets
41-
verbs:
42-
- get
43-
---
44-
apiVersion: rbac.authorization.k8s.io/v1
4530
kind: RoleBinding
4631
metadata:
4732
name: chains-secret-admin
48-
namespace: tekton-chains
33+
namespace: openshift-pipelines
4934
annotations:
5035
argocd.argoproj.io/sync-wave: "0"
5136
roleRef:
@@ -55,29 +40,13 @@ roleRef:
5540
subjects:
5641
- kind: ServiceAccount
5742
name: chains-secrets-admin
58-
namespace: tekton-chains
59-
---
60-
apiVersion: rbac.authorization.k8s.io/v1
61-
kind: RoleBinding
62-
metadata:
63-
name: chains-secret-reader
64-
namespace: openshift-ingress-operator
65-
annotations:
66-
argocd.argoproj.io/sync-wave: "0"
67-
roleRef:
68-
apiGroup: rbac.authorization.k8s.io
69-
kind: Role
70-
name: secret-reader
71-
subjects:
72-
- kind: ServiceAccount
73-
name: chains-secrets-admin
74-
namespace: tekton-chains
43+
namespace: openshift-pipelines
7544
---
7645
apiVersion: batch/v1
7746
kind: Job
7847
metadata:
7948
name: tekton-chains-signing-secret
80-
namespace: tekton-chains
49+
namespace: openshift-pipelines
8150
annotations:
8251
argocd.argoproj.io/sync-wave: "1"
8352
spec:
@@ -94,22 +63,22 @@ spec:
9463
cd /tmp
9564
# Once the key-pair has been set it's marked as immutable so it can't be updated.
9665
# Try to handle that nicely. The object is expected to always exist so check the data.
97-
SIG_KEY_DATA=$(kubectl get secret signing-secrets -n tekton-chains -o jsonpath='{.data}')
66+
SIG_KEY_DATA=$(kubectl get secret signing-secrets -n openshift-pipelines -o jsonpath='{.data}')
9867
if [[ -n $SIG_KEY_DATA ]]; then
9968
echo "Signing secret exists."
10069
else
10170
# To make this run conveniently without user input let's create a random password
10271
RANDOM_PASS=$( head -c 12 /dev/urandom | base64 )
10372
10473
# Generate the key pair secret directly in the cluster.
105-
env COSIGN_PASSWORD=$RANDOM_PASS cosign generate-key-pair k8s://tekton-chains/signing-secrets
74+
env COSIGN_PASSWORD=$RANDOM_PASS cosign generate-key-pair k8s://openshift-pipelines/signing-secrets
10675
fi
10776
10877
# Generate/update the secret with the public key
10978
kubectl create secret generic public-key \
110-
--namespace tekton-chains \
79+
--namespace openshift-pipelines \
11180
--from-literal=cosign.pub="$(
112-
cosign public-key --key k8s://tekton-chains/signing-secrets
81+
cosign public-key --key k8s://openshift-pipelines/signing-secrets
11382
)" \
11483
--dry-run=client \
11584
-o yaml | kubectl apply -f -

operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- allow-argocd-to-manage.yaml
6+
- allow-argocd-to-manage-jobs.yaml
67
- appstudio-pipelines-scc.yaml
78
- openshift-operator.yaml
89
- tekton-config.yaml
910
- config-logging.yaml
1011
- chains-service-monitor.yaml
1112
# Manully add ConfigMap and Service until PLNSRVCE-1359 is fixed
1213
- chains-observability-service.yaml
14+
- chains-public-key-viewer.yaml
15+
- chains-secrets-config.yaml

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

Lines changed: 0 additions & 192 deletions
This file was deleted.

operator/gitops/argocd/pipeline-service/tekton-chains/kustomization.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)