Ziele
- Du verstehst was eine Custom Resource ist und warum das nützlich sein kann.
 - Du weißt, was ein Operator ist und wie dieser funktioniert.
 
Inhalte
- Kapitel 17 aus "The Book of Kubernetes" von Alan Hohn
 - Aggregated ClusterRoles Show archive.org snapshot
 
Aufgaben
- Sprich mit deinem Mentor über Anhang A
 - Sprich mit deinem Mentor über die 
labelsaus Anhang B. 
Anhang A
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: samples.bookofkubernetes.com
spec:
  group: bookofkubernetes.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                value:
                  type: integer
  scope: Namespaced
  names:
    plural: samples
    singular: sample
    kind: Sample
    shortNames:
      - sam
Anhang B
----
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: monitoring
aggregationRule:
  clusterRoleSelectors:
  - matchLabels:
  	rbac.example.com/aggregate-to-monitoring: "true"
rules: [] # The control plane automatically fills in the rules
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: monitoring-endpoints
  labels:
	rbac.example.com/aggregate-to-monitoring: "true"
# When you create the "monitoring-endpoints" ClusterRole,
# the rules below will be added to the "monitoring" ClusterRole.
rules:
- apiGroups: [""]
  resources: ["services", "endpointslices", "pods"]
  verbs: ["get", "list", "watch"]
Posted by Claus-Theodor Riegg to DevOps Curriculum (2023-02-06 13:38)