Skip to content

Commit 6fd73ce

Browse files
yangmvyangmv
authored andcommitted
修改部署配置文件
1 parent a3ac741 commit 6fd73ce

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ RUN wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz
1414
RUN xz -d Python-3.6.6.tar.xz && tar xvf Python-3.6.6.tar && cd Python-3.6.6 && ./configure && make && make install
1515

1616
# 3. 复制代码
17-
#RUN mkdir -p /var/www/
1817
ADD . /var/www/CMDB/
1918
WORKDIR /var/www/CMDB/
2019

-1 Bytes
Binary file not shown.
2.6 KB
Binary file not shown.

deploy.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,21 @@ spec:
2929
subPath: cmdb.conf #以文件的形式挂载
3030
readOnly: true
3131
- name: cmdbnginx
32-
mountPath: /etc/nginx/conf.d/nginx_cmdb.conf
33-
subPath: nginx_cmdb.conf
34-
readOnly: true
32+
mountPath: /etc/nginx/conf.d/
3533

3634
volumes:
3735
- name: cmdbconf
3836
configMap:
3937
name: cmdb-conf #configmap要提前创建好 kubectl create configmap cmdb-conf --from-file=./cmdb.conf -n qa
4038
- name: cmdbnginx
4139
configMap:
42-
name: cmdb-nginx-conf # kubectl create configmap cmdb-nginx-conf --from-file=./cmdb-nginx-conf -n qa
40+
name: cmdb-nginx-conf # kubectl create configmap cmdb-nginx-conf --from-file=./nginx_cmdb.conf -n qa
4341

4442
---
4543
apiVersion: v1
4644
kind: Service
4745
metadata:
48-
name: codo-cmdb
46+
name: codo-cmdb #k8s内网对应的域名为 codo-cmdb.qa.svc.cluster.local
4947
labels:
5048
app: codo-cmdb
5149
spec:
@@ -59,18 +57,19 @@ spec:
5957
targetPort: 80
6058

6159
---
62-
apiVersion: extensions/v1beta1
63-
kind: Ingress
64-
metadata:
65-
name: codo-cmdb-ingress
66-
annotations:
67-
kubernetes.io/ingress.class: "nginx"
68-
spec:
69-
rules:
70-
- host: <DOMAIN>
71-
http:
72-
paths:
73-
- path:
74-
backend:
75-
serviceName: codo-cmdb
76-
servicePort: 80
60+
# api不需要通过ingress反代到外网
61+
#apiVersion: extensions/v1beta1
62+
#kind: Ingress
63+
#metadata:
64+
# name: codo-cmdb-ingress
65+
# annotations:
66+
# kubernetes.io/ingress.class: "nginx"
67+
#spec:
68+
# rules:
69+
# - host: <DOMAIN>
70+
# http:
71+
# paths:
72+
# - path:
73+
# backend:
74+
# serviceName: codo-cmdb
75+
# servicePort: 80

0 commit comments

Comments
 (0)