Without providing information and context it is very hard to determine what could go wrong with your case. Minikube does simply many process and one of is to use ingress as way of exposing services.
Enabling ingress is very easy when using minikube. You just have to enable the addon:
minikube addons enable ingress
Since Ingress does not support TCP or UDP services you will to use flags for this reason this controller uses the flags --tcp-services-configmap
and --udp-services-configmap
to point to an existing config map where the key is the external port to use and the value indicates the service to expose using the format: <namespace/service name>:<service port>:[PROXY]:[PROXY]
Here`s an example of those service:
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: default
spec:
selector:
app: redis
type: ClusterIP
ports:
- name: tcp-port
port: 6379
targetPort: 6379
protocol: TCP
And this is the config map that points to that service:
apiVersion: v1
kind: ConfigMap
metadata:
name: tcp-services
namespace: ingress-nginx
data:
6379 : "default/my-service:6379"
Where:
6379
: the port your service should listen to from outside the minikube virtual machine
default
: the namespace that your service is installed in
service
: the name of the service
Similar config will be applied for the udp protocol:
apiVersion: v1
kind: ConfigMap
metadata:
name: udp-services
namespace: ingress-nginx
data:
53: "kube-system/kube-dns:53"
Minikube documents has very good example if you wish to read more.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…