blob: 2eee89e78bc11f9c14ad2008c996bf2b196e9d07 [file] [log] [blame]
Hong Guan8ba58622018-02-22 10:54:22 -05001#!/bin/sh
2
3# ============LICENSE_START==========================================
4# ===================================================================
5# Copyright (c) 2017 AT&T
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#============LICENSE_END============================================
19
20# this script will install dashboard on k8s master.
21
22#install heapster
23git clone -b release-1.5 https://github.com/kubernetes/heapster.git
24
25kubectl create -f heapster/deploy/kube-config/influxdb/
26kubectl create -f heapster/deploy/kube-config/rbac/heapster-rbac.yaml
27
28#install dashboard
29kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/alternative/kubernetes-dashboard.yaml
30
31##Change spec.type from ClusterIP to NodePort and save.
32kubectl get svc kubernetes-dashboard --namespace=kube-system -o yaml | sed 's/type: ClusterIP/type: NodePort/' | kubectl replace -f -
33
34cat <<EOF >>dashboard-admin.yaml
35apiVersion: rbac.authorization.k8s.io/v1beta1
36kind: ClusterRoleBinding
37metadata:
38 name: kubernetes-dashboard
39 labels:
40 k8s-app: kubernetes-dashboard
41roleRef:
42 apiGroup: rbac.authorization.k8s.io
43 kind: ClusterRole
44 name: cluster-admin
45subjects:
46- kind: ServiceAccount
47 name: kubernetes-dashboard
48 namespace: kube-system
49EOF
50
51kubectl create -f dashboard-admin.yaml
52
53#install helm
54wget http://storage.googleapis.com/kubernetes-helm/helm-$1-linux-amd64.tar.gz
55tar -zxvf helm-$1-linux-amd64.tar.gz
56sudo mv linux-amd64/helm /usr/bin/helm
57
58kubectl -n kube-system create sa tiller
59kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
60helm init --service-account tiller