File tree Expand file tree Collapse file tree
tests/templates/kuttl/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- apiVersion : v1
3- kind : ServiceAccount
4- metadata :
5- name : test-service-account
6- ---
7- kind : Role
8- apiVersion : rbac.authorization.k8s.io/v1
9- metadata :
10- name : test-role
11- rules :
12- - apiGroups :
13- - security.openshift.io
14- resources :
15- - securitycontextconstraints
16- resourceNames :
17- - privileged
18- verbs :
19- - use
20- ---
21- kind : RoleBinding
22- apiVersion : rbac.authorization.k8s.io/v1
23- metadata :
24- name : test-role-binding
25- subjects :
26- - kind : ServiceAccount
27- name : test-service-account
28- - kind : ServiceAccount
29- name : prometheus-stack-kube-prom-admission
30- - kind : ServiceAccount
31- name : prometheus-stack-kube-prom-operator
32- - kind : ServiceAccount
33- name : prometheus-stack-kube-prom-prometheus
34- roleRef :
35- apiGroup : rbac.authorization.k8s.io
36- kind : Role
37- name : test-role
2+ apiVersion : kuttl.dev/v1beta1
3+ kind : TestStep
4+ commands :
5+ - script : >
6+ envsubst '$NAMESPACE' < 01_rbac.yaml |
7+ kubectl apply -n $NAMESPACE -f -
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : v1
3+ kind : ServiceAccount
4+ metadata :
5+ name : test-service-account
6+ ---
7+ kind : Role
8+ apiVersion : rbac.authorization.k8s.io/v1
9+ metadata :
10+ name : test-role
11+ rules :
12+ - apiGroups :
13+ - security.openshift.io
14+ resources :
15+ - securitycontextconstraints
16+ resourceNames :
17+ - privileged
18+ verbs :
19+ - use
20+ ---
21+ # `fullnameOverride` in the Prometheus Helm values must be set to `prometheus-$NAMESPACE`, so that
22+ # the ServiceAccounts are created with the names listed in this RoleBinding.
23+ kind : RoleBinding
24+ apiVersion : rbac.authorization.k8s.io/v1
25+ metadata :
26+ name : test-role-binding
27+ subjects :
28+ - kind : ServiceAccount
29+ name : test-service-account
30+ - kind : ServiceAccount
31+ name : prometheus-$NAMESPACE-admission
32+ - kind : ServiceAccount
33+ name : prometheus-$NAMESPACE-operator
34+ - kind : ServiceAccount
35+ name : prometheus-$NAMESPACE-prometheus
36+ roleRef :
37+ apiGroup : rbac.authorization.k8s.io
38+ kind : Role
39+ name : test-role
Original file line number Diff line number Diff line change 22apiVersion : kuttl.dev/v1beta1
33kind : TestStep
44commands :
5- # Append the namespace to the Helm release name so that cluster-wide
6- # resources get unique names.
5+ # Append the namespace to the Helm release name so that cluster-wide resources get unique names.
6+ # `fullnameOverride` is set to `prometheus-$NAMESPACE`, so that the ServiceAccounts are created
7+ # with the names that are defined in `test-role-binding`.
78 - script : >
89 helm install prometheus-$NAMESPACE
910 --namespace $NAMESPACE
1011 --version 80.14.2
1112 --values 10_kube-prometheus-stack-values.yaml
13+ --set fullnameOverride=prometheus-$NAMESPACE
1214 --wait
1315 oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack
1416 timeout: 600
You can’t perform that action at this time.
0 commit comments