feat(tekton): reconcile url-shortener CI with scoped RBAC
This commit is contained in:
1 parent
6df004a1da
commit
1e20c435cd
3 files changed
+71
No files matched your search
@@ -0,0 +1,22 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: url-shortener-ci
|
||||
namespace: argocd
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "6"
|
||||
spec:
|
||||
project: ci
|
||||
source:
|
||||
repoURL: https://git.dahyeon.us/dahyeon/service-state.git
|
||||
targetRevision: main
|
||||
path: ci/url-shortener
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: tekton-ci
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- SkipDryRunOnMissingResource=true
|
||||
@@ -87,6 +87,27 @@ service-state/
|
||||
Tekton controllers stay in `tekton-pipelines`. Application PipelineRuns and
|
||||
their credentials run in the isolated `tekton-ci` namespace.
|
||||
|
||||
## Registering Additional Service CI
|
||||
|
||||
CI directories in `service-state` are registered explicitly; the service
|
||||
ApplicationSets discover only `apps/*/overlays/*`.
|
||||
|
||||
For URL shortener, `argocd/applications/url-shortener-ci.yaml` reconciles
|
||||
`service-state/ci/url-shortener` into `tekton-ci` using the `ci` project.
|
||||
The platform root Application discovers this registration recursively.
|
||||
|
||||
Cluster-scoped EventListener RBAC belongs in
|
||||
`platform/tekton/config/eventlistener-rbac.yaml`. Each listener receives a
|
||||
dedicated ClusterRole and ClusterRoleBinding allowing only `get`, `list`, and
|
||||
`watch` on `clusterinterceptors` and `clustertriggerbindings`.
|
||||
Keep ServiceAccounts, Roles, and RoleBindings in `service-state`; remove the
|
||||
URL shortener ClusterRoleBinding from its `foundation.yaml` when adopting this
|
||||
registration. The `ci` project intentionally does not allow cluster resources.
|
||||
|
||||
Before the first URL shortener run, configure its Infisical secrets and Gitea
|
||||
push webhook at `https://tekton-hook.dahyeon.us/url-shortener` as defined in
|
||||
`service-state/ci/url-shortener`.
|
||||
|
||||
## Code Style
|
||||
|
||||
Use stable Tekton APIs, explicit names, immutable image references, bounded
|
||||
|
||||
@@ -25,3 +25,31 @@ subjects:
|
||||
- kind: ServiceAccount
|
||||
name: lolympus-event-listener
|
||||
namespace: tekton-ci
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: url-shortener-tekton-eventlistener-interceptors
|
||||
rules:
|
||||
- apiGroups:
|
||||
- triggers.tekton.dev
|
||||
resources:
|
||||
- clusterinterceptors
|
||||
- clustertriggerbindings
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: url-shortener-tekton-eventlistener-interceptors
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: url-shortener-tekton-eventlistener-interceptors
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: url-shortener-event-listener
|
||||
namespace: tekton-ci
|
||||
Reference in new issue
Block a user