macOS ◆ xterm-256color ◆ zsh 186 views

install the operator

kubectl apply -f http://bit.do/log2rbac

create example workload

kubectl create ns monitoring
kubectl apply -n monitoring -f https://github.com/prometheus-operator/kube-prometheus/raw/v0.10.0/manifests/prometheusOperator-deployment.yaml

create RbacNegotiation for Prometheus operator

cat <<CustomResource | kubectl apply -f -
apiVersion: kremser.dev/v1
kind: RbacNegotiation
metadata:
  name: for-prom
spec:
  for:
    namespace: monitoring
    kind: Deployment
    name: prometheus-operator
  role:
    name: foo
CustomResource

check how the role is being populated

watch kubectl describe clusterrole foo

will output something like:

Name:         new-prome-operator-role
Labels:       <none>
Annotations:  app.kubernetes.io/created-by=log2rbac
PolicyRule:
  Resources                                  Non-Resource URLs  Resource Names  Verbs
  ---------                                  -----------------  --------------  -----
  configmaps                                 []                 []              [list watch]
  namespaces                                 []                 []              [list watch]
  secrets                                    []                 []              [list watch]
  statefulsets.apps                          []                 []              [list watch]
  alertmanagerconfigs.monitoring.coreos.com  []                 []              [list]
  alertmanagers.monitoring.coreos.com        []                 []              [list]
  ...

More by jkremser

untitled 00:38

by jkremser

untitled 00:58

by jkremser

Spark Operator Demo 04:17

by jkremser

kubectl kedify plugin 01:05

by jkremser

See all