【kubernetes】Minikube-部署Redis并且通过Ingress访问

Minikube-部署Redis并且通过Ingress访问

yaml配置项目地址: https://github.com/melodyfff/kubernetes-template

启动应用

1
kubectl apply -f app-redis.yaml

添加configmap/tcp-services补丁

1
2
3
4
# 这里的命名空间因为使用的是minikube,具体请查找ingress所在空间
kubectl patch configmap tcp-services -n kube-system --patch '{"data":{"6379":"default/redis-service:6379"}}'

kubectl get configmap tcp-services -n kube-system -o yaml

更新deployment/ingress-nginx-controller补丁

1
kubectl patch deployment ingress-nginx-controller --patch "$(cat ingress-nginx-controller-patch.yaml)" -n kube-system

验证

1
telnet $(minikube ip) 6379

参考

Minikube - nginx_tcp_udp_ingress