4.部署k8s-dashboard
可以查看rc、pod、svc基本信息,还可以部署应用。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
#需要2个yaml文件
[
root
@
test02
-
k8s
-
master
ui
]
# vi dashboard-controller.yaml
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
kubernetes
-
dashboard
-
v1
.
0.1
namespace
:
kube
-
system
labels
:
k8s
-
app
:
kubernetes
-
dashboard
version
:
v1
.
0.1
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
replicas
:
1
selector
:
k8s
-
app
:
kubernetes
-
dashboard
template
:
metadata
:
labels
:
k8s
-
app
:
kubernetes
-
dashboard
version
:
v1
.
0.1
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
containers
:
-
name
:
kubernetes
-
dashboard
image
:
index
.
alauda
.
cn
/
googlecontainer
/
kubernetes
-
dashboard
-
amd64
:
v1
.
0.1
resources
:
limits
:
cpu
:
1
memory
:
50Mi
ports
:
-
containerPort
:
9090
livenessProbe
:
httpGet
:
path
:
/
port
:
9090
initialDelaySeconds
:
30
timeoutSeconds
:
30
args
:
-
--
apiserver
-
host
=
http
:
//192.168.12.174:8080
[
root
@
test02
-
k8s
-
master
ui
]
# vi dashboard-service.yaml
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
kubernetes
-
dashboard
namespace
:
kube
-
system
labels
:
k8s
-
app
:
kubernetes
-
dashboard
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
selector
:
k8s
-
app
:
kubernetes
-
dashboard
ports
:
-
port
:
80
targetPort
:
9090
#创建svc/rc
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f dashboard-controller.yaml
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f dashboard-service.yaml
#查看
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get svc --namespace=kube-system
NAME
CLUSTER_IP
EXTERNAL_IP
PORT
(
S
)
SELECTOR
AGE
dns
-
svc
-
test02
10.254.200.200
<
none
>
53
/
UDP
,
53
/
TCP
k8s
-
app
=
dns
44d
kubernetes
-
dashboard
10.254.85.253
<
none
>
80
/
TCP
k8s
-
app
=
kubernetes
-
dashboard
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get rc --namespace=kube-system
CONTROLLER
CONTAINER
(
S
)
IMAGE
(
S
)
SELECTOR
REPLICAS
AGE
dns
-
rc
-
test02
etcd
index
.
tenxcloud
.
com
/
google_containers
/
etcd
:
2.2.5
k8s
-
app
=
dns
,
kubernetes
.
io
/
cluster
-
service
=
true
,
version
=
v8
1
44d
kube2sky
index
.
tenxcloud
.
com
/
google_containers
/
kube2sky
:
1.15
skydns
index
.
tenxcloud
.
com
/
google_containers
/
skydns
:
2015
-
10
-
13
-
8c72f8c
kubernetes
-
dashboard
-
v1
.
0.1
kubernetes
-
dashboard
index
.
alauda
.
cn
/
googlecontainer
/
kubernetes
-
dashboard
-
amd64
:
v1
.
0.1
k8s
-
app
=
kubernetes
-
dashboard
1
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get pods --namespace=kube-system
NAME
READY
STATUS
RESTARTS
AGE
dns
-
rc
-
test02
-
pk1pd
3
/
3
Running
9
44d
kubernetes
-
dashboard
-
v1
.
0.1
-
kayoo
1
/
1
Running
3
29d
[
root
@
test02
-
k8s
-
master
ui
]
#
|
浏览器打开
http://192.168.12.174:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
5.部署k8s-manager
主要功能是查看k8s的基本信息,比如node、pods、rc、svc等(比k8s-dashboard更直观),但不能部署应用。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#需要2个yaml文件
[
root
@
test02
-
k8s
-
master
ui
]
# vi k8s-manager-rc.yml
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
k8s
-
manager
namespace
:
kube
-
system
labels
:
app
:
k8s
-
manager
spec
:
replicas
:
1
selector
:
app
:
k8s
-
manager
template
:
metadata
:
labels
:
app
:
k8s
-
manager
spec
:
containers
:
-
image
:
192.168.12.37
:
5002
/
mlamina
/
k8s
-
manager
:
latest
name
:
k8s
-
manager
resources
:
limits
:
cpu
:
100m
memory
:
50Mi
ports
:
-
containerPort
:
80
name
:
http
[
root
@
test02
-
k8s
-
master
ui
]
# vi k8s-manager-svc.yml
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
k8s
-
manager
namespace
:
kube
-
system
labels
:
app
:
k8s
-
manager
spec
:
ports
:
-
port
:
80
targetPort
:
http
selector
:
app
:
k8s
-
manager
#部署svc和rc
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f k8s-manager-rc.yml
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f k8s-manager-svc.yml
#查看:
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get svc --namespace=kube-system
NAME
CLUSTER_IP
EXTERNAL_IP
PORT
(
S
)
SELECTOR
AGE
dns
-
svc
-
test02
10.254.200.200
<
none
>
53
/
UDP
,
53
/
TCP
k8s
-
app
=
dns
44d
k8s
-
manager
10.254.117.244
<
none
>
80
/
TCP
app
=
k8s
-
manager
1h
kubernetes
-
dashboard
10.254.85.253
<
none
>
80
/
TCP
k8s
-
app
=
kubernetes
-
dashboard
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get rc --namespace=kube-system
CONTROLLER
CONTAINER
(
S
)
IMAGE
(
S
)
SELECTOR
REPLICAS
AGE
dns
-
rc
-
test02
etcd
index
.
tenxcloud
.
com
/
google_containers
/
etcd
:
2.2.5
k8s
-
app
=
dns
,
kubernetes
.
io
/
cluster
-
service
=
true
,
version
=
v8
1
44d
kube2sky
index
.
tenxcloud
.
com
/
google_containers
/
kube2sky
:
1.15
skydns
index
.
tenxcloud
.
com
/
google_containers
/
skydns
:
2015
-
10
-
13
-
8c72f8c
k8s
-
manager
k8s
-
manager
mlamina
/
k8s
-
manager
:
latest
app
=
k8s
-
manager
1
1h
kubernetes
-
dashboard
-
v1
.
0.1
kubernetes
-
dashboard
index
.
alauda
.
cn
/
googlecontainer
/
kubernetes
-
dashboard
-
amd64
:
v1
.
0.1
k8s
-
app
=
kubernetes
-
dashboard
1
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get pods --namespace=kube-system
NAME
READY
STATUS
RESTARTS
AGE
dns
-
rc
-
test02
-
pk1pd
3
/
3
Running
9
44d
k8s
-
manager
-
v8kxk
1
/
1
Running
1
1h
kubernetes
-
dashboard
-
v1
.
0.1
-
kayoo
1
/
1
Running
3
29d
|
浏览器打开:
http://192.168.12.174:8080/api/v1/proxy/namespaces/kube-system/services/k8s-manager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
#需要2个yaml文件
[
root
@
test02
-
k8s
-
master
ui
]
# vi dashboard-controller.yaml
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
kubernetes
-
dashboard
-
v1
.
0.1
namespace
:
kube
-
system
labels
:
k8s
-
app
:
kubernetes
-
dashboard
version
:
v1
.
0.1
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
replicas
:
1
selector
:
k8s
-
app
:
kubernetes
-
dashboard
template
:
metadata
:
labels
:
k8s
-
app
:
kubernetes
-
dashboard
version
:
v1
.
0.1
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
containers
:
-
name
:
kubernetes
-
dashboard
image
:
index
.
alauda
.
cn
/
googlecontainer
/
kubernetes
-
dashboard
-
amd64
:
v1
.
0.1
resources
:
limits
:
cpu
:
1
memory
:
50Mi
ports
:
-
containerPort
:
9090
livenessProbe
:
httpGet
:
path
:
/
port
:
9090
initialDelaySeconds
:
30
timeoutSeconds
:
30
args
:
-
--
apiserver
-
host
=
http
:
//192.168.12.174:8080
[
root
@
test02
-
k8s
-
master
ui
]
# vi dashboard-service.yaml
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
kubernetes
-
dashboard
namespace
:
kube
-
system
labels
:
k8s
-
app
:
kubernetes
-
dashboard
kubernetes
.
io
/
cluster
-
service
:
"true"
spec
:
selector
:
k8s
-
app
:
kubernetes
-
dashboard
ports
:
-
port
:
80
targetPort
:
9090
#创建svc/rc
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f dashboard-controller.yaml
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f dashboard-service.yaml
#查看
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get svc --namespace=kube-system
NAME
CLUSTER_IP
EXTERNAL_IP
PORT
(
S
)
SELECTOR
AGE
dns
-
svc
-
test02
10.254.200.200
<
none
>
53
/
UDP
,
53
/
TCP
k8s
-
app
=
dns
44d
kubernetes
-
dashboard
10.254.85.253
<
none
>
80
/
TCP
k8s
-
app
=
kubernetes
-
dashboard
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get rc --namespace=kube-system
CONTROLLER
CONTAINER
(
S
)
IMAGE
(
S
)
SELECTOR
REPLICAS
AGE
dns
-
rc
-
test02
etcd
index
.
tenxcloud
.
com
/
google_containers
/
etcd
:
2.2.5
k8s
-
app
=
dns
,
kubernetes
.
io
/
cluster
-
service
=
true
,
version
=
v8
1
44d
kube2sky
index
.
tenxcloud
.
com
/
google_containers
/
kube2sky
:
1.15
skydns
index
.
tenxcloud
.
com
/
google_containers
/
skydns
:
2015
-
10
-
13
-
8c72f8c
kubernetes
-
dashboard
-
v1
.
0.1
kubernetes
-
dashboard
index
.
alauda
.
cn
/
googlecontainer
/
kubernetes
-
dashboard
-
amd64
:
v1
.
0.1
k8s
-
app
=
kubernetes
-
dashboard
1
29d
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl get pods --namespace=kube-system
NAME
READY
STATUS
RESTARTS
AGE
dns
-
rc
-
test02
-
pk1pd
3
/
3
Running
9
44d
kubernetes
-
dashboard
-
v1
.
0.1
-
kayoo
1
/
1
Running
3
29d
[
root
@
test02
-
k8s
-
master
ui
]
#
|
浏览器打开
http://192.168.12.174:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
5.部署k8s-manager
主要功能是查看k8s的基本信息,比如node、pods、rc、svc等(比k8s-dashboard更直观),但不能部署应用。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#需要2个yaml文件
[
root
@
test02
-
k8s
-
master
ui
]
# vi k8s-manager-rc.yml
apiVersion
:
v1
kind
:
ReplicationController
metadata
:
name
:
k8s
-
manager
namespace
:
kube
-
system
labels
:
app
:
k8s
-
manager
spec
:
replicas
:
1
selector
:
app
:
k8s
-
manager
template
:
metadata
:
labels
:
app
:
k8s
-
manager
spec
:
containers
:
-
image
:
192.168.12.37
:
5002
/
mlamina
/
k8s
-
manager
:
latest
name
:
k8s
-
manager
resources
:
limits
:
cpu
:
100m
memory
:
50Mi
ports
:
-
containerPort
:
80
name
:
http
[
root
@
test02
-
k8s
-
master
ui
]
# vi k8s-manager-svc.yml
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
k8s
-
manager
namespace
:
kube
-
system
labels
:
app
:
k8s
-
manager
spec
:
ports
:
-
port
:
80
targetPort
:
http
selector
:
app
:
k8s
-
manager
#部署svc和rc
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f k8s-manager-rc.yml
[
root
@
test02
-
k8s
-
master
ui
]
# kubectl create -f k8s-manager-svc.yml
|