The ingress, of K8s seems to be unable to modify the backend url.

if the api provided by a service is / service/v1/module/method/resource
I want an address

https://service.xxx.com/module/method/resource 

points directly to

/service/v1/module/method/resource 

how do I configure it?

K8s
Mar.12,2021

can ingress listen on other ports
for example, I have a service port of 8848, and I want to access


through 8848 on the public network.

App Root

Create an Ingress rule with an app-root annotation:

$ echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/app-root: /app1
  name: approot
  namespace: default
spec:
  rules:
  - host: approot.bar.com
    http:
      paths:
      - backend:
          serviceName: http-svc
          servicePort: 80
        path: /
" | kubectl create -f -

Check the rewrite is working

$ curl -I -k http://approot.bar.com/
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.11.10
Date: Mon, 13 Mar 2017 14:57:15 GMT
Content-Type: text/html
Content-Length: 162
Location: http://stickyingress.example.com/app1
Connection: keep-alive
  • How k8s invokes or provides services across namespaces

    how to invoke services across namespaces, do you need any permissions? or can services be provided across command spaces? How to configure it? I want to deploy generic services to a separate namespace, not one per space. ...

    K8s
    Mar.17,2021
  • How to use external certificates for ingress of K8s

    does ingress tls have to configure a certificate? my backend service has its own certificate and supports https,. So how to configure it? just like K8s own apiserver, how do you configure the ingress proxy apiserver? ...

    K8s
    Mar.19,2021
  • Kube-apiserver default port range

    I want to change the nodePort range of K8s and modify the startup parameters of kube-apiserver. however, when I added this parameter, I found that the api would not work as long as the port range was not 30000-32768. I have another environment, th...

    Mar.20,2021
  • K8S initialization problem, who has encountered, solve! Timed out waiting for the condition

    < H1 > [init] this might take a minute or longer if the control plane images have to be pulled < H1 > during initialization, the card owner will be used for a long time. Try k8s.gcr.io or a custom image address, and you can actually access it and pull...

    K8s
    Apr.08,2021
  • How to exchange information between K8s node?

    now I have 8 node, programs running the same java program in K8s. if you send a message to someone at 10:00 every day, eight node will be sent eight times. but you only need to send it once. is there any way to set flag bits to allow 8 node messages...

    Apr.25,2021
  • Kubeadm init failed all the time in pull image?

    kubeadm init before I started the command, I had already set up the http and https agents, but there was still an error. What is the reason for this? [preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image [k8s.gcr.io kube...

    May.27,2021
  • Why not use HPA directly to expand the capacity of kubernetes dns horizontally?

    problem description kubernetes dns horizontal expansion document: https: kubernetes.io docs ta. uses cluster-proportional-autoscaler ( https: github.com kubernetes.) Why not just use HPA? What s the difference between HPA and cluster-proportiona...

    Sep.29,2021
  • New expansion of K8S POD has no traffic

    The deployment goes something like this: a svc deploys NGINX, then a svc deploys fpm, and then NGINX proxies to fpm, through svcname to complete the project of accessing PHP with nginx. The problem now is: I expanded the pod of fpm by half, but found tha...

    K8s
    Dec.03,2021
Menu