Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 186187
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 10, 20222022-06-10T18:38:47+00:00 2022-06-10T18:38:47+00:00

Kubernetes nginx Ingress redirect 302

  • 0

[ad_1]

I have an nginx ingress controller and ingress resource for hazlecast running with path /hazlecast-mancenter mapped to hazlecast-mancenter in the backend. When I try to hit “http://hostname/hazlecast-mancenter” the page doesn’t come up . When i check the logs in deployment of ingress controller i get the following logs

192.168.3.193 - - [10/Jun/2022:16:52:58 +0000] "GET /favicon.ico HTTP/2.0" 302 0 "https://james.new-dev.com/hazelcast-mancenter/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537 

Not sure why it is redirecting it here.

Below are the manifests for ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: hazelcast
    meta.helm.sh/release-namespace: default
    nginx.ingress.kubernetes.io/add-base-url: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  creationTimestamp: "2022-06-10T14:18:37Z"
  generation: 6
  labels:
    app.kubernetes.io/instance: hazelcast
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: hazelcast-mancenter
    helm.sh/chart: hazelcast-5.4.1
  name: hazelcast-mancenter
  namespace: default
  resourceVersion: "4041983"
  uid: 36921da3-0757-47c1-9d88-1a87490393df
spec:
  rules:
 - host: james.new-dev.com
    http:
      paths:
      - backend:
          service:
            name: hazelcast-mancenter
            port:
              number: 8080
        path: /hazelcast-mancenter
        pathType: Prefix
  tls:
 - secretName: new-dev-tls

Deployment

kubectl describe sts hazelcast-mancenter
Name:               hazelcast-mancenter
Namespace:          default
CreationTimestamp:  Fri, 10 Jun 2022 14:18:37 +0000
Selector:           app.kubernetes.io/instance=hazelcast,app.kubernetes.io/name=hazelcast-mancenter,role=mancenter
Labels:             app.kubernetes.io/instance=hazelcast
                    app.kubernetes.io/managed-by=Helm
                    app.kubernetes.io/name=hazelcast-mancenter
                    helm.sh/chart=hazelcast-5.4.1
Annotations:        meta.helm.sh/release-name: hazelcast
                    meta.helm.sh/release-namespace: default
Replicas:           1 desired | 1 total
Update Strategy:    RollingUpdate
  Partition:        0
Pods Status:        1 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:           app.kubernetes.io/instance=hazelcast
                    app.kubernetes.io/managed-by=Helm
                    app.kubernetes.io/name=hazelcast-mancenter
                    helm.sh/chart=hazelcast-5.4.1
                    role=mancenter
  Service Account:  hazelcast
  Containers:
   hazelcast-mancenter:
    Image:      hazelcast/management-center:5.1.2
    Port:       8080/TCP
    Host Port:  0/TCP
    Liveness:   http-get http://:8081/health delay=30s timeout=5s period=10s #success=1 #failure=3
    Readiness:  tcp-socket :8080 delay=30s timeout=1s period=10s #success=1 #failure=3
    Environment:
      MC_INIT_CMD:  ./bin/mc-conf.sh cluster add --lenient=true -H /data -cc /config/hazelcast-client.yaml;
      JAVA_OPTS:     -Dhazelcast.mc.healthCheck.enable=true -DserviceName=hazelcast -Dnamespace=default -Dhazelcast.mc.tls.enabled=false
    Mounts:
      /config from config (rw)
      /data from mancenter-storage (rw)
  Volumes:
   config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      hazelcast-mancenter-configuration
    Optional:  false
   mancenter-storage:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
Volume Claims:
  Name:          mancenter-storage
  StorageClass:
  Labels:        app.kubernetes.io/instance=hazelcast
                 app.kubernetes.io/managed-by=Helm
                 app.kubernetes.io/name=hazelcast-mancenter
                 helm.sh/chart=hazelcast-5.4.1
  Annotations:   <none>
  Capacity:      8Gi
  Access Modes:  [ReadWriteOnce]
Events:          <none>

Service

kubectl describe svc hazelcast-mancenter
Name:              hazelcast-mancenter
Namespace:         default
Labels:            app.kubernetes.io/instance=hazelcast
                   app.kubernetes.io/managed-by=Helm
                   app.kubernetes.io/name=hazelcast-mancenter
                   helm.sh/chart=hazelcast-5.4.1
Annotations:       meta.helm.sh/release-name: hazelcast
                   meta.helm.sh/release-namespace: default
Selector:          app.kubernetes.io/instance=hazelcast,app.kubernetes.io/name=hazelcast-mancenter,role=mancenter
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.100.125.152
IPs:               10.100.125.152
Port:              http  8080/TCP
TargetPort:        mancenter/TCP
Endpoints:         192.168.1.190:8080
Port:              https  443/TCP
TargetPort:        mancenter/TCP
Endpoints:         192.168.1.190:8080
Session Affinity:  None
Events:            <none>

I have mapped the ingress port with svc and target port, not sure why the redirect 302 code is thrown

[ad_2]

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 325 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 295 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 291 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.