0

Flask deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: flask-api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flask-api
  template:
    metadata:
      labels:
        app: flask-api
    spec:
      containers:
        - name: flask-api-container
          image: umarrafaqat/flask-app:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 5000
              protocol: TCP
----
apiVersion: v1
kind: Service
metadata:
  name: flask-app-service
spec:
  type: ClusterIP
  ports:
    - port: 5000
  selector:
    app: flask-api

React deployments

apiVersion: apps/v1
kind: Deployment
metadata:
  name: react-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: react-app
  template:
    metadata:
      labels:
        app: react-app
    spec:
      containers:
        - name: react-app-container
          image: umarrafaqat/react-app:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3000
              protocol: TCP
----
apiVersion: v1
kind: Service
metadata:
  name: react-app-service
spec:
  ports:
    - port: 3000
  selector:
    app: react-app

Ingresss

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: react-app-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "true"

spec:
  rules:
  
    - host: localhost
      http:
        paths:
          - backend:
              service:
                name: react-app-service
                port:
                  number: 3000
            path: /
            pathType: Prefix

I want to access this app on a local host but cannot do so. I am running it on minikube

Adiii
  • 54,482
  • 7
  • 145
  • 148
  • Does this answer your question? [Expose port in minikube](https://stackoverflow.com/questions/40767164/expose-port-in-minikube) – Adiii Aug 14 '22 at 07:53
  • Welcome so StackOverflow. Please try to better describe your issue: we don't have any idea what's the error you see, how you came up to see this error. We don't know how your two containers are supposed to interact with each others, if they do, ... – SYN Aug 14 '22 at 08:04
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 15 '22 at 16:23

0 Answers0