k8s容器中配置正向代理
# cat cm-smart-wealth.yaml apiVersion: v1 kind: ConfigMap metadata: name: proxy-config namespace: testing data: HTTP_PROXY: "http://10.244.17.9:8080" HTTPS_PROXY: "http://10.244.17.9:8080" #NO_PROXY: "localhost,127.0.0.1,.example.com" TZ: "Asia/Shanghai" ---------------------------- deployment中的配置: containers: - image: reg1.ka.zkj.com/test/smart-wealth:v1.241112-14-000 imagePullPolicy: IfNotPresent name: smart-wealth ports: - containerPort: 9800 envFrom: - configMapRef: name: proxy-config |
# cat cm-smart-wealth.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-config
namespace: testing
data:
HTTP_PROXY: "http://10.244.17.9:8080"
HTTPS_PROXY: "http://10.244.17.9:8080"
#NO_PROXY: "localhost,127.0.0.1,.example.com"
TZ: "Asia/Shanghai"
----------------------------
deployment中的配置:
containers:
- image: reg1.ka.zkj.com/test/smart-wealth:v1.241112-14-000
imagePullPolicy: IfNotPresent
name: smart-wealth
ports:
- containerPort: 9800
envFrom:
- configMapRef:
name: proxy-config