在minikube中将配置标志传递给nginx-ingress可以通过以下步骤实现:
nginx-ingress-controller.yaml
的文件,并添加以下内容:apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-ingress-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: nginx-ingress
template:
metadata:
labels:
app: nginx-ingress
spec:
containers:
- name: nginx-ingress-controller
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-configuration
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
nginx-configuration.yaml
的文件,并添加以下内容:apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-configuration
namespace: kube-system
data:
use-proxy-protocol: "true"
use-forwarded-headers: "true"
kubectl apply -f nginx-ingress-controller.yaml
kubectl apply -f nginx-configuration.yaml
kubectl get pods -n kube-system
确保nginx-ingress-controller的Pod处于运行状态。
proxy-body-size
配置标志设置为10m
,可以执行以下命令:kubectl annotate configmap nginx-configuration nginx.ingress.kubernetes.io/proxy-body-size=10m -n kube-system
请注意,上述步骤假设您已经安装了nginx-ingress-controller,并且已经在minikube中创建了一个合适的Ingress资源来使用该控制器。如果您还没有安装nginx-ingress-controller或创建Ingress资源,请参考相关文档进行操作。
推荐的腾讯云相关产品:腾讯云容器服务(TKE),产品介绍链接地址:https://cloud.tencent.com/product/tke
领取专属 10元无门槛券
手把手带您无忧上云