yaml例子

mysql

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
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: mysql
spec:
replicas: 1
template:
metadata:
labels:
run: mysql
spec:
containers:
- name: mysql
image: mysql:5.6
env:
- name: MYSQL_ROOT_PASSWORD
value: zhjx@123
ports:
- containerPort: 3306
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql
- name: mysql-config
mountPath: /etc/mysql/conf.d/docker.cnf
subPath: docker.cnf
volumes:
- name: mysql-data
hostPath:
path: /scsidisk/data/mysql
- name: mysql-config
configMap:
name: mysql-config
nodeSelector:
node: node1
---
apiVersion: v1
kind: Service
metadata:
name: mysql-svc
spec:
type: NodePort
selector:
run: mysql
ports:
- protocol: TCP
nodePort: 30000
port: 3306
targetPort: 3306

iwhereearth

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
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: iwhereearth
spec:
replicas: 1
template:
metadata:
labels:
run: earth
spec:
hostAliases:
- ip: 192.168.1.221
hostnames:
- iwhereearthurl
containers:
- name: earth
image: 192.168.1.118:5000/zhjx/iwhereearth:20180817
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
env:
- name: MYSQL_URL
value: mysql-svc
- name: MYSQL_USER
value: root
- name: MYSQL_USER_PASSWORD
value: zhjx@123
# volumeMounts:
# - name: earth-data
# mountPath: /tomcat/webapps
# - name: tomcat-config
# mountPath: /usr/local/tomcat/conf/server.xml
# subPath: server.xml
# volumes:
# - name: earth-data
# hostPath:
# path: /scsidisk/update/iWhereEarth/nfzq_data
# - name: tomcat-config
# configMap:
# name: req-tomcat-config
# nodeSelector:
# node: node1
---
apiVersion: v1
kind: Service
metadata:
name: iwhereearth-svc
spec:
type: NodePort
selector:
run: earth
ports:
- protocol: TCP
nodePort: 30202
port: 8080
targetPort: 8080

iwherelink

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
#apiVersion: v1
#kind: Namespace
#metadata:
# name: iwherelink
#---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: iwherelink
# namespace: iwherelink
spec:
replicas: 1
template:
metadata:
labels:
run: link
spec:
hostAliases:
- ip: 192.168.1.9
hostnames:
- redis
containers:
- name: link
image: 192.168.1.118:5000/zhjx/iwherelink:201808171448
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
env:
- name: MYSQL_URL
value: mysql-svc
- name: MYSQL_USER
value: root
- name: MYSQL_USER_PASSWORD
value: zhjx@123
---
apiVersion: v1
kind: Service
metadata:
name: iwherelink-svc
# namespace: iwherelink
spec:
type: NodePort
selector:
run: link
ports:
- protocol: TCP
nodePort: 30102
port: 80
targetPort: 80

iwherevisual

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
76
77
78
79
80
81
82
83
84
apiVersion: v1
kind: Namespace
metadata:
name: iwherevisual
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: postdb-visual
namespace: iwherevisual
spec:
replicas: 1
template:
metadata:
labels:
run: postdb-visual
spec:
containers:
- name: postdb-visual
image: postgres:9.6.5
imagePullPolicy: IfNotPresent
env:
- name: POSTGIS_PASSWORD
value: admin
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postdb-visual
volumes:
- name: postdb-visual
hostPath:
path: /scsidisk/data/postdb_visual
nodeSelector:
node: node1
---
apiVersion: v1
kind: Service
metadata:
name: postdb-visual-svc
namespace: iwherevisual
spec:
type: NodePort
selector:
run: postdb-visual
ports:
- protocol: TCP
nodePort: 30001
port: 5432
targetPort: 5432
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: iwherevisual
namespace: iwherevisual
spec:
replicas: 1
template:
metadata:
labels:
run: visual
spec:
containers:
- name: visual
image: 192.168.1.118:5000/zhjx/iwherevisual:201904301601
imagePullPolicy: IfNotPresent
ports:
- containerPort: 7001
---
apiVersion: v1
kind: Service
metadata:
name: iwherevisual-svc
namespace: iwherevisual
spec:
type: NodePort
selector:
run: visual
ports:
- protocol: TCP
nodePort: 30101
port: 7001
targetPort: 7001

洞见

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
76
77
78
79
80
81
82
83
84
85
#apiVersion: v1
#kind: Namespace
#metadata:
# name: iwherelink
#---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: dongjian
namespace: zhjx-base
spec:
replicas: 1
template:
metadata:
labels:
run: dongjian
spec:
containers:
- name: tomcat
image: tomcat:8-jre8
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /usr/local/tomcat/webapps
name: dongjian-tomcat
- mountPath: /home/data/insight/upload
name: dongjian-upload
- name: httpd
image: httpd:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/local/apache2/htdocs/upload
name: dongjian-httpd
volumes:
- name: dongjian-tomcat
hostPath:
path: /opt/data/PU2017001_洞见_CI.CD
- name: dongjian-upload
hostPath:
path: /opt/data/PU2017001_洞见_CI.CD/upload
- name: dongjian-httpd
hostPath:
path: /opt/data/PU2017001_洞见_CI.CD/upload
nodeSelector:
node: node2
# env:
# - name: MYSQL_URL
# value: mysql-svc
# - name: MYSQL_USER
# value: root
# - name: MYSQL_USER_PASSWORD
# value: zhjx@123
---
apiVersion: v1
kind: Service
metadata:
name: dongjian-tomcat-svc
namespace: zhjx-base
spec:
type: NodePort
selector:
run: dongjian
ports:
- protocol: TCP
nodePort: 30109
port: 8080
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: dongjian-httpd-svc
namespace: zhjx-base
spec:
type: NodePort
selector:
run: dongjian
ports:
- protocol: TCP
nodePort: 30110
port: 80
targetPort: 80
-------------本文结束感谢您的阅读-------------

本文标题:yaml例子

文章作者:OperationMAN

发布时间:2019年08月09日 - 11:08

最后更新:2022年06月05日 - 21:06

原始链接:https://kxinter.gitee.io/2019/08/09/yaml例子/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

坚持原创技术分享,您的支持将鼓励我继续创作!