简体   繁体   中英

app deployed to Kubernetes but it is not accessible

i'm working with aws eks (Kubernestes cluster) to deploy an application from gitlab to the an aws cluster. When i deploy the app to the cluster i see some services with command kubectl get service --all-namespaces und i get laodbalancer but i can not access to the app. The application called csa-17887811-production (see Screenshot). I think i have to add it to the Pods. when i type kubectl get pods i see only the Hello world application called "web". Could you please show me, how can i access the app from the web browser throw the Loadbalancer.

Note: when i navigate with the loadbalancer link i get this response: default backend - 404 enter image description here

It seems you want to expose the app via nginx ingress. For that you need to create a ClusterIP service and an ingress resource .

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          serviceName: test
          servicePort: 80

A pictorial representation of how you can access pods using ingress and load balancer on AWS.

入口架构

https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM