diff --git a/.zuul.yaml b/.zuul.yaml index f4a15ca..7f5be03 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -17,6 +17,10 @@ name: rbac-helm-functional parent: apply-helm-charts run: playbooks/functional.yaml + vars: + ensure_kubernetes_minikube_addons: [metrics-server] + minikube_dns_resolvers: [1.1.1.1, 8.8.8.8] + collect_kubernetes_logs_namespace: kube-system - project: check: diff --git a/charts/rbac/templates/clusterrole-members.yaml b/charts/rbac/templates/clusterrole-members.yaml index f04ca70..7bab08d 100644 --- a/charts/rbac/templates/clusterrole-members.yaml +++ b/charts/rbac/templates/clusterrole-members.yaml @@ -18,9 +18,9 @@ kind: ClusterRole metadata: name: rbac-members rules: -# List and get nodes +# List and get nodes & pods & pod logs - apiGroups: [""] - resources: ["nodes"] + resources: ["nodes", "pods", "pods/log"] verbs: ["get", "list"] # List all get applications - apiGroups: ["apps"] @@ -28,12 +28,9 @@ rules: verbs: ["get", "list"] # List and get hpa - apiGroups: ["autoscaling"] - resources: ["horizontalpodautoscaler"] - verbs: ["get", "list"] -- apiGroups: [""] - resources: ["pods"] - verbs: ["get", "list"] -# View logs for pods -- apiGroups: [""] - resources: ["pods/log"] + resources: ["horizontalpodautoscalers"] verbs: ["get", "list"] +# View resource usage for nodes and pods +- apiGroups: ["metrics.k8s.io"] + resources: ["nodes", "pods"] + verbs: ["get", "list"] \ No newline at end of file diff --git a/playbooks/functional.yaml b/playbooks/functional.yaml index 0511fb3..21149cb 100644 --- a/playbooks/functional.yaml +++ b/playbooks/functional.yaml @@ -14,12 +14,34 @@ # limitations under the License. - hosts: all + pre_tasks: + - name: Deploy a hpa for test + shell: | + cat <