新增learn-kubernetes(https://github.com/yyong-brs/learn-kubernetes)相关文件
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: todo-proxy-lab
|
||||
labels:
|
||||
app: todo-proxy-lab
|
||||
spec:
|
||||
ports:
|
||||
- port: 8082
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: todo-proxy-lab
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: todo-proxy-lab-configmap
|
||||
data:
|
||||
nginx.conf: |-
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
location / {
|
||||
proxy_pass http://todo-web-lab;
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache STATIC;
|
||||
proxy_cache_valid 200 1d;
|
||||
add_header X-Cache $upstream_cache_status;
|
||||
add_header X-Host $hostname;
|
||||
}
|
||||
}
|
||||
}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: todo-proxy-lab
|
||||
labels:
|
||||
app: todo-proxy-lab
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: todo-proxy-lab
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: todo-proxy-lab
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx:1.17-alpine
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: "/etc/nginx/"
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: todo-proxy-lab-configmap
|
||||
@@ -0,0 +1,33 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: todo-web-lab
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: todo-web-lab
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: todo-web-lab
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: todo-web-lab
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: todo-web-lab
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: kiamol/ch04-todo-list
|
||||
env:
|
||||
- name: Database__Provider
|
||||
value: Sqlite
|
||||
- name: ConnectionStrings__ToDoDb
|
||||
value: "Filename=/data/todo-list-lab.db"
|
||||
Reference in New Issue
Block a user