Answer the question
In order to leave comments, you need to log in
How to make a separate path for each service in k8s within one host?
There are kubernetes. There is 1 external host or another domain.
Kubernetes has different typical applications installed.
helm install ghost --set service.type=ClusterIP bitnami/ghost
helm install drupal --set service.type=ClusterIP bitnami/drupal
helm install tomcat --set service.type=ClusterIP bitnami/tomcat
helm install dokuwiki --set service.type=ClusterIP bitnami/dokuwiki
helm install redmine --set service.type=ClusterIP bitnami/redmine
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: myingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: apatsev.178.154.235.82.sslip.io
http:
paths:
- backend:
serviceName: dokuwiki
servicePort: 80
path: /dokuwiki(/|$)(.*)
- backend:
serviceName: drupal
servicePort: 80
path: /drupal/(.*)
- backend:
serviceName: ghost
servicePort: 80
path: /ghost/(.*)
- backend:
serviceName: redmine
servicePort: 80
path: /redmine/(.*)
- backend:
serviceName: tomcat
servicePort: 80
path: /tomcat/(.*)
Answer the question
In order to leave comments, you need to log in
The config is valid. If it does not work, you need to go to Development Tools and see the errors. Most likely the links are absolute. And you need to make it relative.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: myingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: apatsev.178.154.235.82.sslip.io
http:
paths:
- backend:
serviceName: dokuwiki
servicePort: 80
path: /dokuwiki(/|$)(.*)
- backend:
serviceName: drupal
servicePort: 80
path: /drupal/(.*)
- backend:
serviceName: ghost
servicePort: 80
path: /ghost/(.*)
- backend:
serviceName: redmine
servicePort: 80
path: /redmine/(.*)
- backend:
serviceName: tomcat
servicePort: 80
path: /tomcat/(.*)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question