hongbo-miao/hongbomiao.com

View on GitHub
kubernetes/manifests-raw/yugabyte/operator.yaml

Summary

Maintainability
Test Coverage
apiVersion: v1
kind: Namespace
metadata:
  name: yb-operator
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: yugabyte-operator
  namespace: yb-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  name: yugabyte-operator
rules:
  - apiGroups:
      - ""
    resources:
      - pods
      - services
      - services/finalizers
      - endpoints
      - persistentvolumeclaims
      - events
      - configmaps
      - secrets
    verbs:
      - "*"
  - apiGroups:
      - apps
    resources:
      - deployments
      - daemonsets
      - replicasets
      - statefulsets
    verbs:
      - "*"
  - apiGroups:
      - monitoring.coreos.com
    resources:
      - servicemonitors
    verbs:
      - get
      - create
  - apiGroups:
      - apps
    resourceNames:
      - yugabyte-operator
    resources:
      - deployments/finalizers
    verbs:
      - update
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - get
  - apiGroups:
      - ""
    resources:
      - pods/exec
    verbs:
      - create
  - apiGroups:
      - apps
    resources:
      - replicasets
    verbs:
      - get
  - apiGroups:
      - yugabyte.com
    resources:
      - "*"
    verbs:
      - "*"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: yugabyte-operator
  namespace: yb-operator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: yugabyte-operator
subjects:
  - kind: ServiceAccount
    name: yugabyte-operator
    namespace: yb-operator
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: yugabyte-operator
  namespace: yb-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: yugabyte-operator
  template:
    metadata:
      labels:
        name: yugabyte-operator
    spec:
      serviceAccountName: yugabyte-operator
      containers:
        - name: yugabyte-operator
          # Replace this with the built image name
          image: quay.io/yugabyte/yugabytedb-operator
          command:
            - yugabyte-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "yugabyte-operator"