创建nginx的deployment yaml:
kubectl run --image=nginx nginx -oyaml --dry-run
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
run: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: nginx
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
配置创建Nginx的Config ConfigMap
kubectl create configmap nginx-conf --from-file=./nginx.conf
挂载文件
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
run: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: nginx
spec:
containers:
- image: nginx
name: nginx
resources: {}
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: nginx-conf
subPath: nginx.conf
volumes:
- configMap:
name: nginx-conf
name: nginx-conf
好像并没有,从内存监控结果来看内存还是在一直增加,不过去掉flush之后性能确实有所提高。
http://node:10255/stats/summary
返回全部的pod,我担心会影响性能,大佬,有没有返回单个pod的api?