kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.47k stars 4.89k forks source link

Ingress udp/tcp not working and therefore cannot access the service #19905

Open wusunny2022 opened 1 week ago

wusunny2022 commented 1 week ago

What Happened?

Description: Ingress is not natively support routing of udp/tcp, so need to handle another way. But this is not work in minikube of below procedure.

Procedure of reproduce the issue:

  1. I have mysql-statuefulset.yaml
    
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: mysql-initdb-config
    data:
    init.sql: |
    CREATE DATABASE IF NOT EXISTS mydb;
    ---
    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
    name: my-mysql-stateful-set
    namespace: my-test-app
    spec:
    replicas: 1
    selector:
    matchLabels:
      app: my-mysql
    serviceName: my-mysql
    template:
    metadata:
      labels:
        app: my-mysql
    spec:
      containers:
      - name: mysql
        image: mysql:8.3
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: root
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql
        - name: mysql-initdb
          mountPath: /docker-entrypoint-initdb.d
      volumes:
        - name: mysql-initdb
          configMap:
            name: mysql-initdb-config
    volumeClaimTemplates:
    - metadata:
      name: mysql-persistent-storage
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi

apiVersion: v1 kind: Service metadata: name: mysql-service namespace: my-test-app spec: type: ClusterIP selector: app: my-mysql ports:

Attach the log file

1

Operating System

macOS (Default)

Driver

Docker

kundan2707 commented 1 week ago

/kind support

kundan2707 commented 1 week ago

/assign

kundan2707 commented 1 day ago

@wusunny2022 Can you attach log file in issue. I am not able to find any log in issue