Skip to content

Commit f5e4c52

Browse files
author
Jay Boyd
committed
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/' changes from 3aacfedec6..aa27078754
aa27078754 origin build: add origin tooling bcf37fd 0.1.0-rc2 chart updates (#1410) 4ab0a0a add back 'Processing' message for instance deletion (#1332) 0ecbcb1 Update logs for Cluster service plans. (#1389) 8b491ef Fix a quoting nit (#1400) 63685e4 add orphan mitigation-specific conditions for instances (#1378) adee662 Updated missed fields in service and plan specs (#1406) 2095919 Handle default plan setting when using k8s names (#1405) 607ba66 Document rbacEnable. (#1404) 268294e Adding rbac definition for v1 api endpoint. (#1284) 103288d differentiate between failed updates and provisions during deletion (#1383) eba8ba4 enable API aggregation and Service Catalog RBAC on Jenkins (#1333) 5a93315 Validate relistDuration is non-negative (#1395) e279d21 Fix log messages for secrets (#1385) 87fa8c9 fix status update when starting orphan mitigation (#1372) 11f18f3 Switch to wget for integration apiserver checks (#1384) 8c44a7d update OSB client to 2.13 (#1392) e64bbd1 default plan admission controller: filter list of service plans/service classes by the class name (#1351) 6648c0e Check field names. Fix issue 1291 (#1379) 5319841 update comment for instance generation check (#1382) 7d5823f remove internal poll method (#1381) 07d3068 Rework the logging for controller_instance. (#1371) 5f4ca01 address PR comment as a followup (#1380) 485d5e6 Add support for specifying plan using K8S names. (#1377) 662bba8 Log number of secret keys created for binding credential (#1375) 8ad6a31 Move controller constants into correct files (#1373) 7bd66dd Adding type to log. (#1339) 1ce5c4d Remove k8s/k8s dependency (#1355) b458323 Adding log formatting for BindingController. (#1352) 275eb11 rename test variables to be consistent (#1315) ffd6b8b travis: skip cleanup before deploy (#1368) d5ecc04 fix travis tag checker (#1365) 2cae0ee Minor updates to README (#1360) REVERT: 3aacfedec6 carry: Set external plan name for service-catalog walkthrough REVERT: 3ec9e5b07a origin build: add origin tooling git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog git-subtree-split: aa2707875461dd51be3731b1d94b5cfc3b9a3976
1 parent 46dccda commit f5e4c52

File tree

10,281 files changed

+5978
-2142561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,281 files changed

+5978
-2142561
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cache:
88
script:
99
- make verify build test images
1010
deploy:
11+
skip_cleanup: true
1112
provider: script
1213
script: contrib/travis/deploy.sh
1314
on:

Jenkinsfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ def test_zone = params.TEST_ZONE ?: 'us-west1-b'
6666
def namespace = 'catalog'
6767
def root_path = 'src/github.com/kubernetes-incubator/service-catalog'
6868
def timeoutMin = 30
69+
def certFolder = '/tmp/sc-certs'
6970

7071
node {
7172
echo "Service Catalog end-to-end test"
7273

7374
sh "sudo rm -rf ${env.WORKSPACE}/*"
75+
sh "rm -rf ${certFolder} && mkdir ${certFolder}"
7476

7577
updatePullRequest('run')
7678

@@ -120,6 +122,7 @@ node {
120122
--create-artifacts
121123
"""
122124

125+
/*
123126
ansiColor('xterm-darker-gray') {
124127
// Run the e2e test framework
125128
sh """${env.ROOT}/contrib/jenkins/run_e2e.sh \
@@ -129,6 +132,7 @@ node {
129132
--create-artifacts
130133
"""
131134
}
135+
*/
132136

133137
echo 'Run succeeded.'
134138
}
@@ -137,8 +141,9 @@ node {
137141
currentBuild.result = 'FAILURE'
138142
} finally {
139143
archiveArtifacts artifacts: 'walkthrough*.txt', fingerprint: true
140-
archiveArtifacts artifacts: 'e2e*.txt', fingerprint: true
144+
// archiveArtifacts artifacts: 'e2e*.txt', fingerprint: true
141145
try {
146+
sh "rm -rf ${certFolder}"
142147
sh """${env.ROOT}/contrib/jenkins/cleanup_cluster.sh --kubeconfig ${KUBECONFIG}"""
143148
} catch (Exception e) {
144149
echo 'Exception caught during cleanup.'

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ USER_BROKER_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(VERSION)
8686
USER_BROKER_MUTABLE_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(MUTABLE_TAG)
8787

8888
# precheck to avoid kubernetes-incubator/service-catalog#361
89-
$(if $(realpath vendor/k8s.io/kubernetes/vendor), \
90-
$(error the vendor directory exists in the kubernetes \
89+
$(if $(realpath vendor/k8s.io/apimachinery/vendor), \
90+
$(error the vendor directory exists in the apimachinery \
9191
vendored source and must be flattened. \
9292
run 'glide i -v'))
9393

@@ -188,6 +188,7 @@ $(BINDIR)/e2e.test: .init $(NEWEST_E2ETEST_SOURCE) $(NEWEST_GO_FILE)
188188
# Generate conversions
189189
$(DOCKER_CMD) $(BINDIR)/conversion-gen \
190190
--v 1 --logtostderr \
191+
--extra-peer-dirs k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
191192
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \
192193
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog" \
193194
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog/v1beta1" \
@@ -228,6 +229,7 @@ verify: .init .generate_files verify-client-gen
228229
@# observes conventions from upstream that will not pass lint checks).
229230
@$(DOCKER_CMD) sh -c \
230231
'for i in $$(find $(TOP_SRC_DIRS) -name *.go \
232+
| grep -v ^pkg/kubernetes/ \
231233
| grep -v generated \
232234
| grep -v ^pkg/client/ \
233235
| grep -v v1beta1/defaults.go); \

README.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _somewhere_ in a simple way:
3232
cluster as the consumer or a different cluster, or even creating a new
3333
tenant in a multi-tenant SaaS system. The point is that the
3434
consumer doesn't have to be aware of or care at all about the details.
35-
3. The user requests a _credential_ to use the service instance in their application
35+
3. The user requests a _binding_ to use the service instance in their application
3636

3737
Credentials are delivered to users in normal Kubernetes secrets and
3838
contain information necessary to connect to and authenticate to the
@@ -59,13 +59,6 @@ Kubernetes 1.8. See the
5959
[milestones list](https://github.com/kubernetes-incubator/service-catalog/milestones?direction=desc&sort=due_date&state=open)
6060
for information about the issues and PRs in current and future milestones.
6161

62-
**NOTE**: Some fields in our API may still be considered **ALPHA** after the
63-
API graduates to **BETA**. These fields are prefixed with `alpha` in
64-
JSON/YAML. Alpha fields are provided for use at your own risk, may not work
65-
correctly, may be subject to change or removal at any time, and will not have
66-
data migration provided for them when they graduate past alpha. When an alpha
67-
field graduates past alpha, the `alpha` prefix will be removed.
68-
6962
The project [roadmap](https://github.com/kubernetes-incubator/service-catalog/wiki/Roadmap)
7063
contains information about our high-level goals for future milestones.
7164

build/build-image/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ RUN curl -sSL https://github.com/Masterminds/glide/releases/download/$GLIDE_VERS
2424
| tar -vxz -C /usr/local/bin --strip=1
2525

2626
# Install etcd
27-
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.0/etcd-v3.1.0-linux-amd64.tar.gz \
28-
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.0-linux-amd64/etcd
27+
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.10/etcd-v3.1.10-linux-amd64.tar.gz \
28+
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.10-linux-amd64/etcd
2929

3030
# Install the golint, use this to check our source for niceness
3131
RUN go get -u github.com/golang/lint/golint

build/verify-errexit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333

3434
# Gather the list of files that appear to be shell scripts.
3535
# Meaning they have some form of "#!...sh" as a line in them.
36-
shFiles=$(grep -rl '^#!.*sh$' $args)
36+
shFiles=$(grep -rl '^#!.*sh$' $args | grep -v ^pkg/kubernetes/)
3737

3838
tmp=/tmp/out$RANDOM
3939
for file in ${shFiles}; do

charts/catalog/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ chart and their default values.
4040

4141
| Parameter | Description | Default |
4242
|-----------|-------------|---------|
43-
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc1` |
43+
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc2` |
4444
| `apiserver.imagePullPolicy` | `imagePullPolicy` for the apiserver | `Always` |
4545
| `apiserver.tls.cert` | Base64-encoded x509 certificate | A self-signed certificate |
4646
| `apiserver.tls.key` | Base64-encoded private key | The private key for the certificate above |
@@ -53,12 +53,13 @@ chart and their default values.
5353
| `apiserver.storage.etcd.servers` | If storage type is `etcd`: etcd URL(s); override this if NOT using embedded etcd | `http://localhost:2379` |
5454
| `apiserver.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
5555
| `apiserver.auth.enabled` | Enable authentication and authorization | `false` |
56-
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc1` |
56+
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc2` |
5757
| `controllerManager.imagePullPolicy` | `imagePullPolicy` for the controller-manager | `Always` |
5858
| `controllerManager.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
5959
| `controllerManager.resyncInterval` | How often the controller should resync informers; duration format (`20m`, `1h`, etc) | `5m` |
6060
| `controllerManager.brokerRelistInterval` | How often the controller should relist the catalogs of ready brokers; duration format (`20m`, `1h`, etc) | `24h` |
6161
| `useAggregator` | whether or not to set up the controller-manager to go through the main Kubernetes API server's API aggregator (requires setting `apiserver.tls.ca` to work) | `false` |
62+
| `rbacEnable` | If true, create & use RBAC resources | `true` |
6263

6364
Specify each parameter using the `--set key=value[,key=value]` argument to
6465
`helm install`.

charts/catalog/templates/_helpers.tpl

+12
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
77
{{- define "fullname" -}}
88
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
99
{{- end -}}
10+
11+
{{/*
12+
Conditionally print out rbac api verison.
13+
This will select v1 before v1beta1 if both are available.
14+
*/}}
15+
{{- define "rbacApiVersion" -}}
16+
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" -}}
17+
rbac.authorization.k8s.io/v1
18+
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}}
19+
rbac.authorization.k8s.io/v1beta1
20+
{{- end -}}
21+
{{- end -}}

charts/catalog/templates/rbac.yaml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }}
1+
{{- if .Values.rbacEnable }}
22
apiVersion: v1
33
kind: List
44
items:
55

66
### API Server ###
7-
7+
88
# TODO: if this is just for namespace lifecycle admission, move to a generic role
99
# the role for the apiserver
10-
- apiVersion: rbac.authorization.k8s.io/v1beta1
10+
- apiVersion: {{template "rbacApiVersion" . }}
1111
kind: ClusterRole
1212
metadata:
1313
name: "servicecatalog.k8s.io:apiserver"
@@ -18,7 +18,7 @@ items:
1818
resources: ["namespaces"]
1919
verbs: ["get", "list", "watch"]
2020
# API-server service-account gets its own role
21-
- apiVersion: rbac.authorization.k8s.io/v1beta1
21+
- apiVersion: {{template "rbacApiVersion" . }}
2222
kind: ClusterRoleBinding
2323
metadata:
2424
name: "servicecatalog.k8s.io:apiserver"
@@ -33,7 +33,7 @@ items:
3333
namespace: "{{ .Release.Namespace }}"
3434
# apiserver gets the auth-delegator role to delegate auth decisions to
3535
# the core apiserver
36-
- apiVersion: rbac.authorization.k8s.io/v1beta1
36+
- apiVersion: {{template "rbacApiVersion" . }}
3737
kind: ClusterRoleBinding
3838
metadata:
3939
name: "servicecatalog.k8s.io:apiserver-auth-delegator"
@@ -49,7 +49,7 @@ items:
4949
# apiserver gets the ability to read authentication. This allows it to
5050
# read the specific configmap that has the requestheader-* entries to
5151
# enable api aggregation
52-
- apiVersion: rbac.authorization.k8s.io/v1beta1
52+
- apiVersion: {{template "rbacApiVersion" . }}
5353
kind: RoleBinding
5454
metadata:
5555
name: "servicecatalog.k8s.io:apiserver-authentication-reader"
@@ -69,7 +69,7 @@ items:
6969
# controller-manager role defines what access the service-catalog
7070
# controller-manager needs to manage the resources of the
7171
# service-catalog
72-
- apiVersion: rbac.authorization.k8s.io/v1beta1
72+
- apiVersion: {{template "rbacApiVersion" . }}
7373
kind: ClusterRole
7474
metadata:
7575
name: "servicecatalog.k8s.io:controller-manager"
@@ -98,7 +98,7 @@ items:
9898
resources: ["clusterservicebrokers/status","serviceinstances/status","serviceinstances/reference","servicebindings/status"]
9999
verbs: ["update"]
100100
# give the controller-manager service account access to whats defined in its role.
101-
- apiVersion: rbac.authorization.k8s.io/v1beta1
101+
- apiVersion: {{template "rbacApiVersion" . }}
102102
kind: ClusterRoleBinding
103103
metadata:
104104
name: "servicecatalog.k8s.io:controller-manager"
@@ -114,7 +114,7 @@ items:
114114

115115
# This gives create/update access to an endpoint in kube-system for leader election
116116
# TODO: use an object other than endpoints, and in the same namespace as the service catalog, not in kube-system
117-
- apiVersion: rbac.authorization.k8s.io/v1beta1
117+
- apiVersion: {{template "rbacApiVersion" . }}
118118
kind: Role
119119
metadata:
120120
name: "servicecatalog.k8s.io:leader-locking-controller-manager"
@@ -127,7 +127,7 @@ items:
127127
resources: ["endpoints"]
128128
resourceNames: ["service-catalog-controller-manager"]
129129
verbs: ["get","update"]
130-
- apiVersion: rbac.authorization.k8s.io/v1beta1
130+
- apiVersion: {{template "rbacApiVersion" . }}
131131
kind: RoleBinding
132132
metadata:
133133
name: service-catalog-controller-manager
@@ -141,4 +141,4 @@ items:
141141
kind: ServiceAccount
142142
name: "{{ .Values.controllerManager.serviceAccount }}"
143143
namespace: "{{ .Release.Namespace }}"
144-
{{ end }}
144+
{{end}}

charts/catalog/values.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Default values for Service Catalog
22
# determines whether the API server should be registered with the kube-aggregator
33
useAggregator: false
4+
## If true, create & use RBAC resources
5+
##
6+
rbacEnable: true
47
apiserver:
58
# apiserver image to use
6-
image: quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc1
9+
image: quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc2
710
# imagePullPolicy for the apiserver; valid values are "IfNotPresent",
811
# "Never", and "Always"
912
imagePullPolicy: Always
@@ -68,7 +71,7 @@ apiserver:
6871
serviceAccount: service-catalog-apiserver
6972
controllerManager:
7073
# controller-manager image to use
71-
image: quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc1
74+
image: quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc2
7275
# imagePullPolicy for the controller-manager; valid values are
7376
# "IfNotPresent", "Never", and "Always"
7477
imagePullPolicy: Always

charts/ups-broker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Service Broker
3434

3535
| Parameter | Description | Default |
3636
|-----------|-------------|---------|
37-
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc1` |
37+
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc2` |
3838
| `imagePullPolicy` | `imagePullPolicy` for the ups-broker | `Always` |
3939

4040
Specify each parameter using the `--set key=value[,key=value]` argument to

charts/ups-broker/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Default values for User-Provided Service Broker
22
# Image to use
3-
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc1
3+
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc2
44
# ImagePullPolicy; valid values are "IfNotPresent", "Never", and "Always"
55
imagePullPolicy: Always
66
# Certificate details to use for TLS. Leave blank to not use TLS

cmd/apiserver/app/server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
"github.com/golang/glog"
2525
"github.com/kubernetes-incubator/service-catalog/pkg"
26+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/interrupt"
2627
"github.com/kubernetes-incubator/service-catalog/pkg/registry/servicecatalog/server"
2728
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/broker/authsarcheck"
2829
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/namespace/lifecycle"
@@ -32,7 +33,6 @@ import (
3233
"github.com/spf13/cobra"
3334
"k8s.io/apiserver/pkg/admission"
3435
genericserveroptions "k8s.io/apiserver/pkg/server/options"
35-
"k8s.io/kubernetes/pkg/util/interrupt"
3636
)
3737

3838
const (

cmd/controller-manager/app/controller_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ import (
3737
"k8s.io/client-go/tools/clientcmd"
3838
"k8s.io/client-go/tools/record"
3939

40+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/configz"
4041
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4142
"k8s.io/apimachinery/pkg/runtime/schema"
4243
"k8s.io/apimachinery/pkg/util/wait"
4344
"k8s.io/apiserver/pkg/server/healthz"
4445
"k8s.io/client-go/tools/leaderelection"
4546
"k8s.io/client-go/tools/leaderelection/resourcelock"
46-
"k8s.io/kubernetes/pkg/util/configz"
4747

4848
// The API groups for our API must be installed before we can use the
4949
// client to work with them. This needs to be done once per process; this

cmd/controller-manager/app/options/options.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
utilfeature "k8s.io/apiserver/pkg/util/feature"
2828

2929
"github.com/kubernetes-incubator/service-catalog/pkg/apis/componentconfig"
30+
k8scomponentconfig "github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/apis/componentconfig"
31+
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/client/leaderelectionconfig"
3032
osb "github.com/pmorie/go-open-service-broker-client/v2"
31-
k8scomponentconfig "k8s.io/kubernetes/pkg/apis/componentconfig"
32-
"k8s.io/kubernetes/pkg/client/leaderelectionconfig"
3333
)
3434

3535
// ControllerManagerServer is the main context object for the controller

contrib/hack/start-server.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ count=0
5252
D_HOST=${DOCKER_HOST:-localhost}
5353
D_HOST=${D_HOST#*//} # remove leading proto://
5454
D_HOST=${D_HOST%:*} # remove trailing port #
55-
while ! curl --cacert ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT} > /dev/null 2>&1 ; do
55+
while ! wget --ca-certificate ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT} > /dev/null 2>&1 ; do
5656
sleep 1
5757
(( count++ )) || true
5858
if [ "${count}" == "30" ]; then
5959
echo "Timed-out waiting for API Server"
60-
(set -x ; curl --cacert ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT})
60+
(set -x ; wget --ca-certificate ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT})
6161
(set -x ; docker ps)
6262
(set -x ; docker logs apiserver)
6363
exit 1

contrib/jenkins/init_cluster.sh

+8-9
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,33 @@ gcloud auth activate-service-account \
4848

4949
echo "Creating cluster ${CLUSTERNAME}"
5050

51-
# Use the latest 1.6.X version that GKE offers.
51+
# Use the latest 1.7.X version that GKE offers.
5252
CLUSTER_VERSION="$(gcloud container get-server-config --zone "${ZONE}" \
5353
| awk '
5454
BEGIN {p=0};
5555
/validMasterVersions:/ {p=1; next};
5656
/validNodeVersions:/ {exit};
57-
p && /1.6/ {print $2; exit}
57+
p && /1.7/ {print $2; exit}
5858
')"
5959

6060
[[ -n "${CLUSTER_VERSION}" ]] \
61-
|| { echo 'Could not find valid 1.6.X cluster version on Google Container Engine.'; exit 1; }
61+
|| { echo 'Could not find valid 1.7.X cluster version on Google Container Engine.'; exit 1; }
6262

6363
echo "Using cluster version ${CLUSTER_VERSION}"
6464

6565
gcloud container clusters create "${CLUSTERNAME}" --project="${PROJECT}" --zone="${ZONE}" \
66-
--cluster-version "${CLUSTER_VERSION}" \
66+
--cluster-version "${CLUSTER_VERSION}" --no-enable-legacy-authorization \
6767
|| { echo 'Cannot create cluster.'; exit 1; }
6868

6969
echo "Using cluster ${CLUSTERNAME}."
7070

7171
gcloud container clusters get-credentials "${CLUSTERNAME}" --project="${PROJECT}" --zone="${ZONE}" \
7272
|| { echo 'Cannot get credentials for cluster.'; exit 1; }
7373

74-
# On GKE you need to give your user proper permissions in order to create new
75-
# cluster roles. Needed for RBAC setup.
76-
ACCOUNT_NAME="$(gcloud info | grep Account | sed 's/.*\[\(.*\)\]/\1/')"
77-
kubectl create clusterrolebinding jenkins-cluster-admin-binding \
78-
--clusterrole=cluster-admin --user="${ACCOUNT_NAME}" \
74+
# Need to give tiller proper permissions in order to create RBAC roles.
75+
kubectl create clusterrolebinding tiller-cluster-admin \
76+
--clusterrole=cluster-admin \
77+
--serviceaccount=kube-system:default \
7978
|| { echo 'Cannot not create cluster-admin role for service account.'; exit 1; }
8079

8180
helm init \

0 commit comments

Comments
 (0)