iac_modules/Solutions/Observability/example/yaml/mirrors-oss-deploy.yaml

92 lines
1.8 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: nginx
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: nginx
data:
default.conf: |
server {
listen 80;
server_name mirrors.onwalk.net;
index index.html index.htm;
location / {
proxy_pass http://mirrors-oss.oss-cn-wulanchabu-internal.aliyuncs.com;
proxy_set_header Host mirrors-oss.oss-cn-wulanchabu-internal.aliyuncs.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 500m;
proxy_redirect off;
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: harbor.onwalk.net/public/nginx:1.16.0
imagePullPolicy: IfNotPresent
volumeMounts:
- name: config-volume
mountPath: /etc/nginx/conf.d
volumes:
- name: config-volume
configMap:
name: nginx-config
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
namespace: nginx
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mirrors-ingress
namespace: nginx
spec:
ingressClassName: nginx
rules:
- host: mirrors.onwalk.net
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: nginx-svc
port:
number: 80
tls:
- hosts:
- mirrors.onwalk.net
secretName: nginx-tls