26 Eylül 2022 Pazartesi

Kubernetes kind : ClusterRole

Örnek
Açıklaması şöyle
To allow Hazelcast to use the service inside Kubernetes for the discovery, we also need to grant certain permissions. An example of RBAC configuration for default namespace you can find in Hazelcast documentation.
Hangi kaynaklara hangi verb'lerin uygulanabileceği belirtilir. Şeklen şöyle
resource olarak şunlar olabilir
1. endpoints
2. pods
3.  nodes
4. services
verb olarak şunlar olabilir
1. get, 
2. list, 
3. watch 

Örnek
Şöyle yaparız
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: hazelcast-cluster-role
rules:
  - apiGroups:
      - ""
    resources:
      - endpoints
      - pods
      - nodes
      - services
    verbs:
      - get
      - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: hazelcast-cluster-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: hazelcast-cluster-role
subjects:
  - kind: ServiceAccount
    name: default
    namespace: default

Hiç yorum yok:

Yorum Gönder

Kubernetes kind: Cluster

Örnek Şöyle yaparız apiVersion: cluster.k8s.io/v1alpha1 kind: Cluster metadata: name: my-cluster spec: autoscaler: enabled: true ...