k8s部署rocketMQ

举报
TonySprite 发表于 2023/05/29 14:12:09 2023/05/29
【摘要】 CCE rocketMQ yaml部署文件

以下是整理好的可以在华为云CCE一键式部署的rocketMQ YAML文件

kind: Deployment
apiVersion: apps/v1
metadata:
  name: console
  namespace: rocket
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq-console
  template:
    metadata:
      labels:
        app: rocketmq-console
    spec:
      containers:
        - name: console
          image: swr.cn-north-4.myhuaweicloud.com/shadiao/rocketmq-console-login:2.0.0
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: rocketmq-operator
  namespace: rocket
spec:
  replicas: 1
  selector:
    matchLabels:
      name: rocketmq-operator
  template:
    metadata:
      labels:
        name: rocketmq-operator
    spec:
      containers:
        - name: rocketmq-operator
          image: swr.cn-north-4.myhuaweicloud.com/shadiao/rocketmq-operator:0.3.0-snapshot
          command:
            - rocketmq-operator
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: rocketmq-operator
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: rocketmq-operator
      serviceAccount: rocketmq-operator
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: broker-0-master
  namespace: rocket
  generation: 2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: broker
      broker_cr: broker
      role: master
  template:
    metadata:
      labels:
        app: broker
        broker_cr: broker
        role: master
    spec:
      volumes:
        - name: broker-config
          configMap:
            name: broker-config
            items:
              - key: broker-common.conf
                path: broker-common.conf
            defaultMode: 420
      containers:
        - name: broker
          image: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0
          ports:
            - name: vip
              containerPort: 10909
              protocol: TCP
            - name: main
              containerPort: 10911
              protocol: TCP
            - name: ha
              containerPort: 10912
              protocol: TCP
          env:
            - name: NAMESRV_ADDR
              value: 10.2.52.189:9876
            - name: BROKER_ID
              value: '0'
            - name: BROKER_CLUSTER_NAME
              value: broker
            - name: BROKER_NAME
              value: broker-0
            - name: BROKER_MEM
              valueFrom:
                configMapKeyRef:
                  name: broker-config
                  key: BROKER_MEM
          resources:
            limits:
              cpu: 400m
              memory: 9600Mi
            requests:
              cpu: 200m
              memory: 1600Mi
          volumeMounts:
            - name: broker-storage
              mountPath: /root/logs
              subPath: logs/broker-0-master
            - name: broker-storage
              mountPath: /root/store
              subPath: store/broker-0-master
            - name: broker-config
              mountPath: /root/rocketmq/broker/conf/broker-common.conf
              subPath: broker-common.conf
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/bash
                  - '-c'
                  - echo Initial broker
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app: broker
                  broker_cr: broker
                  role: master
              topologyKey: kubernetes.io/hostname
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: broker
                    broker_cr: broker
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: broker-storage
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 8Gi
        storageClassName: csi-nas
        volumeMode: Filesystem
      status:
        phase: Pending
  serviceName: ''
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
  revisionHistoryLimit: 10
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: broker-0-replica-1
  namespace: rocket
  generation: 1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: broker
      broker_cr: broker
      role: replica
  template:
    metadata:
      labels:
        app: broker
        broker_cr: broker
        role: replica
    spec:
      volumes:
        - name: broker-config
          configMap:
            name: broker-config
            items:
              - key: broker-common.conf
                path: broker-common.conf
            defaultMode: 420
      containers:
        - name: broker
          image: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0
          ports:
            - name: vip
              containerPort: 10909
              protocol: TCP
            - name: main
              containerPort: 10911
              protocol: TCP
            - name: ha
              containerPort: 10912
              protocol: TCP
          env:
            - name: NAMESRV_ADDR
              value: 10.2.5.137:9876;10.2.52.189:9876
            - name: BROKER_ID
              value: '1'
            - name: BROKER_CLUSTER_NAME
              value: broker
            - name: BROKER_NAME
              value: broker-0
            - name: BROKER_MEM
              valueFrom:
                configMapKeyRef:
                  name: broker-config
                  key: BROKER_MEM
          resources:
            limits:
              cpu: 400m
              memory: 9600Mi
            requests:
              cpu: 200m
              memory: 1600Mi
          volumeMounts:
            - name: broker-storage
              mountPath: /root/logs
              subPath: logs/broker-0-replica-1
            - name: broker-storage
              mountPath: /root/store
              subPath: store/broker-0-replica-1
            - name: broker-config
              mountPath: /root/rocketmq/broker/conf/broker-common.conf
              subPath: broker-common.conf
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/bash
                  - '-c'
                  - echo Initial broker
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: broker
                    broker_cr: broker
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: broker-storage
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 8Gi
        storageClassName: csi-nas
        volumeMode: Filesystem
      status:
        phase: Pending
  serviceName: ''
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
  revisionHistoryLimit: 10
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: broker-1-master
  namespace: rocket
  generation: 1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: broker
      broker_cr: broker
      role: master
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: broker
        broker_cr: broker
        role: master
    spec:
      volumes:
        - name: broker-config
          configMap:
            name: broker-config
            items:
              - key: broker-common.conf
                path: broker-common.conf
            defaultMode: 420
      containers:
        - name: broker
          image: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0
          ports:
            - name: vip
              containerPort: 10909
              protocol: TCP
            - name: main
              containerPort: 10911
              protocol: TCP
            - name: ha
              containerPort: 10912
              protocol: TCP
          env:
            - name: NAMESRV_ADDR
              value: 10.2.5.137:9876;10.2.52.189:9876
            - name: BROKER_ID
              value: '0'
            - name: BROKER_CLUSTER_NAME
              value: broker
            - name: BROKER_NAME
              value: broker-1
            - name: BROKER_MEM
              valueFrom:
                configMapKeyRef:
                  name: broker-config
                  key: BROKER_MEM
          resources:
            limits:
              cpu: 400m
              memory: 9600Mi
            requests:
              cpu: 200m
              memory: 1600Mi
          volumeMounts:
            - name: broker-storage
              mountPath: /root/logs
              subPath: logs/broker-1-master
            - name: broker-storage
              mountPath: /root/store
              subPath: store/broker-1-master
            - name: broker-config
              mountPath: /root/rocketmq/broker/conf/broker-common.conf
              subPath: broker-common.conf
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/bash
                  - '-c'
                  - echo Initial broker
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app: broker
                  broker_cr: broker
                  role: master
              topologyKey: kubernetes.io/hostname
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: broker
                    broker_cr: broker
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: broker-storage
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 8Gi
        storageClassName: csi-nas
        volumeMode: Filesystem
      status:
        phase: Pending
  serviceName: ''
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
  revisionHistoryLimit: 10
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: broker-1-replica-1
  namespace: rocket
  generation: 1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: broker
      broker_cr: broker
      role: replica
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: broker
        broker_cr: broker
        role: replica
    spec:
      volumes:
        - name: broker-config
          configMap:
            name: broker-config
            items:
              - key: broker-common.conf
                path: broker-common.conf
            defaultMode: 420
      containers:
        - name: broker
          image: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0
          ports:
            - name: vip
              containerPort: 10909
              protocol: TCP
            - name: main
              containerPort: 10911
              protocol: TCP
            - name: ha
              containerPort: 10912
              protocol: TCP
          env:
            - name: NAMESRV_ADDR
              value: 10.2.5.137:9876;10.2.52.189:9876
            - name: BROKER_ID
              value: '1'
            - name: BROKER_CLUSTER_NAME
              value: broker
            - name: BROKER_NAME
              value: broker-1
            - name: BROKER_MEM
              valueFrom:
                configMapKeyRef:
                  name: broker-config
                  key: BROKER_MEM
          resources:
            limits:
              cpu: 400m
              memory: 9600Mi
            requests:
              cpu: 200m
              memory: 1600Mi
          volumeMounts:
            - name: broker-storage
              mountPath: /root/logs
              subPath: logs/broker-1-replica-1
            - name: broker-storage
              mountPath: /root/store
              subPath: store/broker-1-replica-1
            - name: broker-config
              mountPath: /root/rocketmq/broker/conf/broker-common.conf
              subPath: broker-common.conf
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/bash
                  - '-c'
                  - echo Initial broker
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: broker
                    broker_cr: broker
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: broker-storage
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 8Gi
        storageClassName: csi-nas
        volumeMode: Filesystem
      status:
        phase: Pending
  serviceName: ''
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
  revisionHistoryLimit: 10

---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: name-service
  namespace: rocket
  generation: 1
spec:
  replicas: 2
  selector:
    matchLabels:
      app: name_service
      name_service_cr: name-service
  template:
    metadata:
      labels:
        app: name_service
        name_service_cr: name-service
    spec:
      containers:
        - name: name-service
          image: swr.cn-north-4.myhuaweicloud.com/shadiao/rocketmq-nameserver:4.5.0-alpine-operator-0.3.0
          ports:
            - name: main
              hostPort: 9876
              containerPort: 9876
              protocol: TCP
          resources:
            limits:
              cpu: 250m
              memory: 500Mi
            requests:
              cpu: 100m
              memory: 500Mi
          volumeMounts:
            - name: namesrv-storage
              mountPath: /root/logs
              subPath: logs
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      securityContext: {}
      schedulerName: default-scheduler
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: namesrv-storage
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 1Gi
        storageClassName: csi-nas
        volumeMode: Filesystem
      status:
        phase: Pending
  serviceName: ''
  podManagementPolicy: OrderedReady
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      partition: 0
  revisionHistoryLimit: 10
---
metadata:
  name: console-service
  namespace: rocket
  labels:
    app: rocketmq-console
  finalizers:
    - service.kubernetes.io/load-balancer-cleanup
spec:
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 30596
  selector:
    app: rocketmq-console
  type: LoadBalancer
  sessionAffinity: None
  externalTrafficPolicy: Cluster
apiVersion: v1
kind: Service
---
apiVersion: v1
kind: Service
metadata:
  name: name-server-service
  namespace: rocket
  finalizers:
    - service.kubernetes.io/load-balancer-cleanup
spec:
  ports:
    - protocol: TCP
      port: 9876
      targetPort: 9876
      nodePort: 30229
  selector:
    name_service_cr: name-service
  type: LoadBalancer
  externalTrafficPolicy: Cluster
---
metadata:
  name: rocketmq-operator
  namespace: rocket
  labels:
    name: rocketmq-operator
spec:
  ports:
    - name: metrics
      protocol: TCP
      port: 8383
      targetPort: 8383
  selector:
    name: rocketmq-operator
  type: ClusterIP
apiVersion: v1
kind: Service
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: rocketmq-operator #ClusterRoleBinding的名字
subjects:
  - kind: ServiceAccount
    name: rocketmq-operator #serviceaccount资源对象的name
    namespace: rocket #serviceaccount的namespace
roleRef:
  kind: ClusterRole 
  name: cluster-admin #k8s集群中最高权限的角色
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: rocketmq-operator # ServiceAccount的名字
  namespace: rocket # serviceaccount的namespace
  labels:
    app: rocketmq-operator #ServiceAccount的标签
---
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1
metadata:
  name: federatedclusterrolebindings.types.kubefed.io
  generation: 1
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"apiextensions.k8s.io/v1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"name":"federatedclusterrolebindings.types.kubefed.io"},"spec":{"group":"types.kubefed.io","names":{"kind":"FederatedClusterRoleBinding","plural":"federatedclusterrolebindings"},"scope":"Cluster","versions":[{"name":"v1beta1","schema":{"openAPIV3Schema":{"properties":{"apiVersion":{"type":"string"},"kind":{"type":"string"},"metadata":{"type":"object"},"spec":{"properties":{"overrides":{"items":{"properties":{"clusterName":{"type":"string"},"clusterOverrides":{"items":{"properties":{"op":{"pattern":"^(add|remove|replace)?$","type":"string"},"path":{"type":"string"},"value":{"x-kubernetes-preserve-unknown-fields":true}},"required":["path"],"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"placement":{"properties":{"clusterSelector":{"properties":{"matchExpressions":{"items":{"properties":{"key":{"type":"string"},"operator":{"type":"string"},"values":{"items":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"},"matchLabels":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"clusters":{"items":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"}},"type":"object"},"template":{"type":"object","x-kubernetes-preserve-unknown-fields":true}},"type":"object"},"status":{"properties":{"clusters":{"items":{"properties":{"name":{"type":"string"},"remoteStatus":{"type":"object","x-kubernetes-preserve-unknown-fields":true},"status":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"},"conditions":{"items":{"properties":{"lastTransitionTime":{"format":"date-time","type":"string"},"lastUpdateTime":{"format":"date-time","type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"required":["type","status"],"type":"object"},"type":"array"},"observedGeneration":{"format":"int64","type":"integer"}},"type":"object"}},"required":["spec"],"type":"object"}},"served":true,"storage":true,"subresources":{"status":{}}}]}}
spec:
  group: types.kubefed.io
  names:
    plural: federatedclusterrolebindings
    singular: federatedclusterrolebinding
    kind: FederatedClusterRoleBinding
    listKind: FederatedClusterRoleBindingList
  scope: Cluster
  versions:
    - name: v1beta1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              type: object
              properties:
                overrides:
                  type: array
                  items:
                    type: object
                    properties:
                      clusterName:
                        type: string
                      clusterOverrides:
                        type: array
                        items:
                          type: object
                          required:
                            - path
                          properties:
                            op:
                              type: string
                              pattern: ^(add|remove|replace)?$
                            path:
                              type: string
                            value:
                              x-kubernetes-preserve-unknown-fields: true
                placement:
                  type: object
                  properties:
                    clusterSelector:
                      type: object
                      properties:
                        matchExpressions:
                          type: array
                          items:
                            type: object
                            required:
                              - key
                              - operator
                            properties:
                              key:
                                type: string
                              operator:
                                type: string
                              values:
                                type: array
                                items:
                                  type: string
                        matchLabels:
                          type: object
                          additionalProperties:
                            type: string
                    clusters:
                      type: array
                      items:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                template:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
            status:
              type: object
              properties:
                clusters:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                    properties:
                      name:
                        type: string
                      remoteStatus:
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      status:
                        type: string
                conditions:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - status
                    properties:
                      lastTransitionTime:
                        type: string
                        format: date-time
                      lastUpdateTime:
                        type: string
                        format: date-time
                      reason:
                        type: string
                      status:
                        type: string
                      type:
                        type: string
                observedGeneration:
                  type: integer
                  format: int64
      subresources:
        status: {}
  conversion:
    strategy: None
---
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1
metadata:
  name: federatedserviceaccounts.types.kubefed.io
  generation: 1
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"apiextensions.k8s.io/v1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"name":"federatedserviceaccounts.types.kubefed.io"},"spec":{"group":"types.kubefed.io","names":{"kind":"FederatedServiceAccount","plural":"federatedserviceaccounts","shortNames":["fsa"]},"scope":"Namespaced","versions":[{"name":"v1beta1","schema":{"openAPIV3Schema":{"properties":{"apiVersion":{"type":"string"},"kind":{"type":"string"},"metadata":{"type":"object"},"spec":{"properties":{"overrides":{"items":{"properties":{"clusterName":{"type":"string"},"clusterOverrides":{"items":{"properties":{"op":{"pattern":"^(add|remove|replace)?$","type":"string"},"path":{"type":"string"},"value":{"x-kubernetes-preserve-unknown-fields":true}},"required":["path"],"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"placement":{"properties":{"clusterSelector":{"properties":{"matchExpressions":{"items":{"properties":{"key":{"type":"string"},"operator":{"type":"string"},"values":{"items":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"},"matchLabels":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"clusters":{"items":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"}},"type":"object"},"template":{"type":"object","x-kubernetes-preserve-unknown-fields":true}},"type":"object"},"status":{"properties":{"clusters":{"items":{"properties":{"name":{"type":"string"},"remoteStatus":{"type":"object","x-kubernetes-preserve-unknown-fields":true},"status":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"},"conditions":{"items":{"properties":{"lastTransitionTime":{"format":"date-time","type":"string"},"lastUpdateTime":{"format":"date-time","type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"required":["type","status"],"type":"object"},"type":"array"},"observedGeneration":{"format":"int64","type":"integer"}},"type":"object"}},"required":["spec"],"type":"object"}},"served":true,"storage":true,"subresources":{"status":{}}}]}}
spec:
  group: types.kubefed.io
  names:
    plural: federatedserviceaccounts
    singular: federatedserviceaccount
    shortNames:
      - fsa
    kind: FederatedServiceAccount
    listKind: FederatedServiceAccountList
  scope: Namespaced
  versions:
    - name: v1beta1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              type: object
              properties:
                overrides:
                  type: array
                  items:
                    type: object
                    properties:
                      clusterName:
                        type: string
                      clusterOverrides:
                        type: array
                        items:
                          type: object
                          required:
                            - path
                          properties:
                            op:
                              type: string
                              pattern: ^(add|remove|replace)?$
                            path:
                              type: string
                            value:
                              x-kubernetes-preserve-unknown-fields: true
                placement:
                  type: object
                  properties:
                    clusterSelector:
                      type: object
                      properties:
                        matchExpressions:
                          type: array
                          items:
                            type: object
                            required:
                              - key
                              - operator
                            properties:
                              key:
                                type: string
                              operator:
                                type: string
                              values:
                                type: array
                                items:
                                  type: string
                        matchLabels:
                          type: object
                          additionalProperties:
                            type: string
                    clusters:
                      type: array
                      items:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                template:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
            status:
              type: object
              properties:
                clusters:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                    properties:
                      name:
                        type: string
                      remoteStatus:
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      status:
                        type: string
                conditions:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - status
                    properties:
                      lastTransitionTime:
                        type: string
                        format: date-time
                      lastUpdateTime:
                        type: string
                        format: date-time
                      reason:
                        type: string
                      status:
                        type: string
                      type:
                        type: string
                observedGeneration:
                  type: integer
                  format: int64
      subresources:
        status: {}
  conversion:
    strategy: None
---
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1
metadata:
  name: federatedclusterroles.types.kubefed.io
  generation: 1
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"apiextensions.k8s.io/v1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"name":"federatedclusterroles.types.kubefed.io"},"spec":{"group":"types.kubefed.io","names":{"kind":"FederatedClusterRole","plural":"federatedclusterroles"},"scope":"Cluster","versions":[{"name":"v1beta1","schema":{"openAPIV3Schema":{"properties":{"apiVersion":{"type":"string"},"kind":{"type":"string"},"metadata":{"type":"object"},"spec":{"properties":{"overrides":{"items":{"properties":{"clusterName":{"type":"string"},"clusterOverrides":{"items":{"properties":{"op":{"pattern":"^(add|remove|replace)?$","type":"string"},"path":{"type":"string"},"value":{"x-kubernetes-preserve-unknown-fields":true}},"required":["path"],"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"placement":{"properties":{"clusterSelector":{"properties":{"matchExpressions":{"items":{"properties":{"key":{"type":"string"},"operator":{"type":"string"},"values":{"items":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"},"matchLabels":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"clusters":{"items":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"}},"type":"object"},"template":{"type":"object","x-kubernetes-preserve-unknown-fields":true}},"type":"object"},"status":{"properties":{"clusters":{"items":{"properties":{"name":{"type":"string"},"remoteStatus":{"type":"object","x-kubernetes-preserve-unknown-fields":true},"status":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"},"conditions":{"items":{"properties":{"lastTransitionTime":{"format":"date-time","type":"string"},"lastUpdateTime":{"format":"date-time","type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"required":["type","status"],"type":"object"},"type":"array"},"observedGeneration":{"format":"int64","type":"integer"}},"type":"object"}},"required":["spec"],"type":"object"}},"served":true,"storage":true,"subresources":{"status":{}}}]}}
spec:
  group: types.kubefed.io
  names:
    plural: federatedclusterroles
    singular: federatedclusterrole
    kind: FederatedClusterRole
    listKind: FederatedClusterRoleList
  scope: Cluster
  versions:
    - name: v1beta1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              type: object
              properties:
                overrides:
                  type: array
                  items:
                    type: object
                    properties:
                      clusterName:
                        type: string
                      clusterOverrides:
                        type: array
                        items:
                          type: object
                          required:
                            - path
                          properties:
                            op:
                              type: string
                              pattern: ^(add|remove|replace)?$
                            path:
                              type: string
                            value:
                              x-kubernetes-preserve-unknown-fields: true
                placement:
                  type: object
                  properties:
                    clusterSelector:
                      type: object
                      properties:
                        matchExpressions:
                          type: array
                          items:
                            type: object
                            required:
                              - key
                              - operator
                            properties:
                              key:
                                type: string
                              operator:
                                type: string
                              values:
                                type: array
                                items:
                                  type: string
                        matchLabels:
                          type: object
                          additionalProperties:
                            type: string
                    clusters:
                      type: array
                      items:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                template:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
            status:
              type: object
              properties:
                clusters:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                    properties:
                      name:
                        type: string
                      remoteStatus:
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      status:
                        type: string
                conditions:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - status
                    properties:
                      lastTransitionTime:
                        type: string
                        format: date-time
                      lastUpdateTime:
                        type: string
                        format: date-time
                      reason:
                        type: string
                      status:
                        type: string
                      type:
                        type: string
                observedGeneration:
                  type: integer
                  format: int64
      subresources:
        status: {}
  conversion:
    strategy: None
---
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。