1

I have a google cloud kubernetes cluster, service definition:

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: 2018-05-14T18:53:57Z
  labels:
    run: sv-security
  name: sv-security
  namespace: default
  resourceVersion: "554"
  selfLink: /api/v1/namespaces/default/services/sv-security
  uid: 27e476db-57a8-11e8-9053-42010a84014c
spec:
  clusterIP: 10.47.245.44
  externalTrafficPolicy: Cluster
  ports:
  - nodePort: 32290
    port: 80
    protocol: TCP
    targetPort: 8080
  selector:
    run: sv-security
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 35.205.38.34

and I would like to have HTTPS enabled. I followed some tutorials and got the following ingress config:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-sv-security
  annotations:
    kubernetes.io/ingress.allow-http: "false"
spec:
  backend:
    serviceName: sv-security
    servicePort: 80

(tried with serivce port 32290 as well). And created it with "kubectl apply -f ingress-sv-security.yaml"

When I go to the ip address, I get "default backend - 404".

When I run "kubectl describe ing", I get:

Name:             ingress-sv-security
Namespace:        default
Address:          35.201.113.164
Default backend:  sv-security:32290 (<none>)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *     *     sv-security:32290 (<none>)
Annotations:
  url-map:          k8s-um-default-ingress-sv-security--d01e081d01fdd251
  backends:         {"k8s-be-32062--d01e081d01fdd251":"HEALTHY"}
  forwarding-rule:  k8s-fw-default-ingress-sv-security--d01e081d01fdd251
  target-proxy:     k8s-tp-default-ingress-sv-security--d01e081d01fdd251
Events:
  Type     Reason   Age               From                     Message
  ----     ------   ----              ----                     -------
  Normal   ADD      19m               loadbalancer-controller  default/ingress-sv-security
  Normal   CREATE   18m               loadbalancer-controller  ip: 35.201.113.164
  Warning  Service  0s (x8 over 18m)  loadbalancer-controller  failed to identify user specified default backend, couldn't find nodeport for default/sv-security, using system default

What am I doing wrong here?

  • where is your secret? when you describe your service, do you have any endpoints? – suren Jun 16 '18 at 20:03
1

An Ingress with no rules, sends all traffic to a single default backend. See here for the Prerequisites

For encrypted communication between the client to the load balancer, you need to specify a TLS private key and certificate to be used by the ingress controller. see here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.