TKE中configMap的使用
测试文件
nginx.conf
apiVersion: v1
data:
nginx.conf: |2-
user nginx;
worker_processes 1;
# test line
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
kind: ConfigMap
metadata:
creationTimestamp: "2020-06-02T09:19:45Z"
name: nginx-conf
namespace: test
resourceVersion: "10479370942"
selfLink: /api/v1/namespaces/test/configmaps/nginx-conf
uid: 32ca67ac-a4b2-11ea-9c35-e28957d7d0b3nginx-env
test.txt
如何挂载配置文件到容器内

如何引用configMap的值作为环境变量

最后更新于