From c128fb42c5467401c46e5d09fdc86fd2b990e0de Mon Sep 17 00:00:00 2001 From: Vishal Thapar <5137689+vthapar@users.noreply.github.com> Date: Mon, 2 Nov 2020 17:07:16 +0530 Subject: [PATCH] Install MCS SIG CRDs and roles This installs the `multicluster.x-k8s.io` CRDs and roles for them Fixes:submariner-io/lighthouse#336 Signed-off-by: Vishal Thapar <5137689+vthapar@users.noreply.github.com> --- submariner-k8s-broker/templates/crd.yaml | 56 +++++++++++++++++++++++ submariner-k8s-broker/templates/rbac.yaml | 3 ++ submariner/templates/crd.yaml | 56 +++++++++++++++++++++++ submariner/templates/rbac.yaml | 3 ++ 4 files changed, 118 insertions(+) diff --git a/submariner-k8s-broker/templates/crd.yaml b/submariner-k8s-broker/templates/crd.yaml index 416ae5b..bacd265 100644 --- a/submariner-k8s-broker/templates/crd.yaml +++ b/submariner-k8s-broker/templates/crd.yaml @@ -106,5 +106,61 @@ spec: plural: serviceimports singular: serviceimport scope: Namespaced +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: serviceexports.multicluster.x-k8s.io + annotations: + "helm.sh/hook": crd-install +spec: + group: multicluster.x-k8s.io + scope: Namespaced + names: + plural: serviceexports + singular: serviceexport + kind: ServiceExport + shortNames: + - svcex + versions: + - name: v1alpha1 + served: true + storage: true + additionalPrinterColumns: + - name: Age + type: date + jsonPath: .metadata.creationTimestamp +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: serviceimports.multicluster.x-k8s.io + annotations: + "helm.sh/hook": crd-install +spec: + group: multicluster.x-k8s.io + scope: Namespaced + names: + plural: serviceimports + singular: serviceimport + kind: ServiceImport + shortNames: + - svcim + versions: + - name: v1alpha1 + served: true + storage: true + additionalPrinterColumns: + - name: Type + type: string + description: The type of this ServiceImport + jsonPath: .spec.type + - name: IP + type: string + description: The VIP for this ServiceImport + jsonPath: .spec.ips + - name: Age + type: date + jsonPath: .metadata.creationTimestamp {{- end -}} {{- end -}} \ No newline at end of file diff --git a/submariner-k8s-broker/templates/rbac.yaml b/submariner-k8s-broker/templates/rbac.yaml index 65940c0..4b7492c 100644 --- a/submariner-k8s-broker/templates/rbac.yaml +++ b/submariner-k8s-broker/templates/rbac.yaml @@ -18,6 +18,9 @@ rules: - apiGroups: ["discovery.k8s.io"] resources: ["endpointslices"] verbs: ["create", "get", "list", "watch","patch", "update", "delete"] +- apiGroups: ["multicluster.x-k8s.io"] + resources: ["*"] + verbs: ["create", "get", "list", "watch", "update", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/submariner/templates/crd.yaml b/submariner/templates/crd.yaml index 36605ee..177ee6d 100644 --- a/submariner/templates/crd.yaml +++ b/submariner/templates/crd.yaml @@ -106,5 +106,61 @@ spec: plural: serviceimports singular: serviceimport scope: Namespaced +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: serviceexports.multicluster.x-k8s.io + annotations: + "helm.sh/hook": crd-install +spec: + group: multicluster.x-k8s.io + scope: Namespaced + names: + plural: serviceexports + singular: serviceexport + kind: ServiceExport + shortNames: + - svcex + versions: + - name: v1alpha1 + served: true + storage: true + additionalPrinterColumns: + - name: Age + type: date + jsonPath: .metadata.creationTimestamp +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: serviceimports.multicluster.x-k8s.io + annotations: + "helm.sh/hook": crd-install +spec: + group: multicluster.x-k8s.io + scope: Namespaced + names: + plural: serviceimports + singular: serviceimport + kind: ServiceImport + shortNames: + - svcim + versions: + - name: v1alpha1 + served: true + storage: true + additionalPrinterColumns: + - name: Type + type: string + description: The type of this ServiceImport + jsonPath: .spec.type + - name: IP + type: string + description: The VIP for this ServiceImport + jsonPath: .spec.ips + - name: Age + type: date + jsonPath: .metadata.creationTimestamp {{- end }} {{- end -}} diff --git a/submariner/templates/rbac.yaml b/submariner/templates/rbac.yaml index a2aae8d..30e6644 100644 --- a/submariner/templates/rbac.yaml +++ b/submariner/templates/rbac.yaml @@ -129,6 +129,9 @@ rules: - apiGroups: ["submariner.io"] resources: ["gateways"] verbs: ["get", "list", "watch"] + - apiGroups: ["multicluster.x-k8s.io"] + resources: ["*"] + verbs: ["create", "get", "list", "watch", "update", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding