apiVersion: v1 kind: ServiceAccount metadata: name: harness --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: harness-k8s-reader rules: - apiGroups: [""] resources: ["pods", "pods/log", "services", "configmaps", "namespaces", "events"] verbs: ["get", "list", "watch"] - apiGroups: ["apps"] resources: ["deployments", "statefulsets", "daemonsets", "replicasets"] verbs: ["get", "list", "watch"] - apiGroups: ["batch"] resources: ["jobs", "cronjobs"] verbs: ["get", "list", "watch"] - apiGroups: ["networking.k8s.io"] resources: ["ingresses"] verbs: ["get", "list", "watch"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: harness-k8s-reader subjects: - kind: ServiceAccount name: harness namespace: apps roleRef: kind: ClusterRole name: harness-k8s-reader apiGroup: rbac.authorization.k8s.io