ingress-gce icon indicating copy to clipboard operation
ingress-gce copied to clipboard

How to properly redirect www.* to non www

Open Scalahansolo opened this issue 3 years ago • 3 comments

Currently on my GCE ingress, www.* does not get routed anywhere based on our configs. How do I set my ingress such that www.* get's routed to a particular service?

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: { .Values.ingressName }}
  annotations:
    kubernetes.io/ingress.class: "gce"
...
spec:
  rules: 
  - host: {{ .Values.web.host }}
    http:
      paths:
      - path: /*
        pathType: ImplementationSpecific
        backend:
          service:
            name: web-service
            port:
              number: {{ .Values.web.port }}

Scalahansolo avatar Mar 14 '22 21:03 Scalahansolo

/kind support

kundan2707 avatar Mar 17 '22 10:03 kundan2707

The configuration above will match your <hostname>/ * & <hostname>/. Is the request to match <hostname> ?

To match please specify a spec.defaultBackend. This will be where all routes that do not match any of the rules will be sent to.

swetharepakula avatar Jun 15 '22 00:06 swetharepakula

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 13 '22 00:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Oct 13 '22 00:10 k8s-triage-robot

Did you ever find a solution for this issue? I am facing the same thing. With nginx ingress there is just an annotation but for gce.....

SaltyCoco avatar Nov 07 '22 16:11 SaltyCoco

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Dec 07 '22 17:12 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 07 '22 17:12 k8s-ci-robot

Did you ever find a solution for this issue? I am facing the same thing. With nginx ingress there is just an annotation but for gce.....

Found anything?

swapnil-gohil avatar Oct 27 '23 06:10 swapnil-gohil