From a879a9527e5f5706549cb68d2df87d751a5fc920 Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 25 Dec 2019 16:49:45 +0800 Subject: [PATCH 1/3] ci: add k8s v1.17 support --- ci/pingcap_tidb_operator_build_kind.groovy | 3 +++ hack/e2e.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/ci/pingcap_tidb_operator_build_kind.groovy b/ci/pingcap_tidb_operator_build_kind.groovy index f589057a7c..10ad1bb63f 100644 --- a/ci/pingcap_tidb_operator_build_kind.groovy +++ b/ci/pingcap_tidb_operator_build_kind.groovy @@ -191,6 +191,9 @@ def call(BUILD_BRANCH, CREDENTIALS_ID, CODECOV_CREDENTIALS_ID) { builds["E2E v1.16.3"] = { build("${MIRRORS} IMAGE_TAG=${GITHASH} SKIP_BUILD=y GINKGO_NODES=8 KUBE_VERSION=v1.16.3 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.16.3_ ./hack/e2e.sh -- --ginkgo.skip='\\[Serial\\]'", artifacts) } + builds["E2E v1.17.0"] = { + build("${MIRRORS} IMAGE_TAG=${GITHASH} SKIP_BUILD=y GINKGO_NODES=8 KUBE_VERSION=v1.17.0 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.17.0_ ./hack/e2e.sh -- --ginkgo.skip='\\[Serial\\]'", artifacts) + } builds["E2E v1.12.10 Serial"] = { build("${MIRRORS} IMAGE_TAG=${GITHASH} SKIP_BUILD=y KUBE_VERSION=v1.12.10 REPORT_DIR=\$(pwd)/artifacts REPORT_PREFIX=v1.12.10_serial_ ./hack/e2e.sh -- --ginkgo.focus='\\[Serial\\]' --install-operator=false", artifacts) } diff --git a/hack/e2e.sh b/hack/e2e.sh index c79e6f9c8f..f6e31f32e8 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -113,6 +113,7 @@ kind_node_images["v1.13.12"]="kindest/node:v1.13.12@sha256:1fe072c080ee129a2a440 kind_node_images["v1.14.9"]="kindest/node:v1.14.9@sha256:bdd3731588fa3ce8f66c7c22f25351362428964b6bca13048659f68b9e665b72" kind_node_images["v1.15.6"]="kindest/node:v1.15.6@sha256:18c4ab6b61c991c249d29df778e651f443ac4bcd4e6bdd37e0c83c0d33eaae78" kind_node_images["v1.16.3"]="kindest/node:v1.16.3@sha256:70ce6ce09bee5c34ab14aec2b84d6edb260473a60638b1b095470a3a0f95ebec" +kind_node_images["v1.17.0"]="kindest/node:v1.17.0@sha256:190c97963ec4f4121c3f1e96ca6eb104becda5bae1df3a13f01649b2dd372f6d" function e2e::image_build() { if [ -n "$SKIP_BUILD" ]; then From eda13de7c6b6bfc23890227d2eca678619d6e87a Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 25 Dec 2019 18:43:00 +0800 Subject: [PATCH 2/3] add lease rule --- charts/tidb-operator/templates/scheduler-rbac.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/tidb-operator/templates/scheduler-rbac.yaml b/charts/tidb-operator/templates/scheduler-rbac.yaml index 0c702ce13b..d988c7499e 100644 --- a/charts/tidb-operator/templates/scheduler-rbac.yaml +++ b/charts/tidb-operator/templates/scheduler-rbac.yaml @@ -42,6 +42,9 @@ rules: - apiGroups: [""] resources: ["endpoints"] verbs: ["delete", "get", "patch", "update"] +- apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "create", "update"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 @@ -95,6 +98,9 @@ rules: - apiGroups: [""] resources: ["endpoints"] verbs: ["delete", "get", "patch", "update"] +- apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + verbs: ["get", "create", "update"] --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 From bc929e33bae011b8986a930ef7e210d8d080165f Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 25 Dec 2019 20:26:16 +0800 Subject: [PATCH 3/3] address comment --- charts/tidb-operator/templates/scheduler-rbac.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/tidb-operator/templates/scheduler-rbac.yaml b/charts/tidb-operator/templates/scheduler-rbac.yaml index d988c7499e..48bf72831c 100644 --- a/charts/tidb-operator/templates/scheduler-rbac.yaml +++ b/charts/tidb-operator/templates/scheduler-rbac.yaml @@ -44,7 +44,11 @@ rules: verbs: ["delete", "get", "patch", "update"] - apiGroups: ["coordination.k8s.io"] resources: ["leases"] - verbs: ["get", "create", "update"] + verbs: ["create"] +- apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + resourceNames: ["{{ .Values.scheduler.schedulerName }}"] + verbs: ["get", "update"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 @@ -100,7 +104,11 @@ rules: verbs: ["delete", "get", "patch", "update"] - apiGroups: ["coordination.k8s.io"] resources: ["leases"] - verbs: ["get", "create", "update"] + verbs: ["create"] +- apiGroups: ["coordination.k8s.io"] + resources: ["leases"] + resourceNames: ["{{ .Values.scheduler.schedulerName }}"] + verbs: ["get", "update"] --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1