mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
完善k8s文件
This commit is contained in:
@@ -2,6 +2,8 @@ resources:
|
||||
- api.yaml
|
||||
- redis.yaml
|
||||
- pg.yaml
|
||||
- ns.yaml
|
||||
- nginx.yaml
|
||||
|
||||
|
||||
|
||||
|
||||
73
k8s/base/nginx.yaml
Normal file
73
k8s/base/nginx.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
selector:
|
||||
app: nginx
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 8000
|
||||
type: NodePort
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-conf
|
||||
data:
|
||||
default.conf: |
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
proxypass http://coal-ui:7456/;
|
||||
}
|
||||
location /api {
|
||||
proxypass http://coal-api:7456/;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nginx
|
||||
template:
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- mountPath: /etc/nginx/conf.d/default.conf
|
||||
name: nginx-conf
|
||||
subPath: default.conf
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: nginx-conf
|
||||
configMap:
|
||||
items:
|
||||
- key: default.conf
|
||||
path: default.conf
|
||||
4
k8s/base/ns.yaml
Normal file
4
k8s/base/ns.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: coal
|
||||
Reference in New Issue
Block a user