Skip to content

Support a subset of annotations on the service resources#269

Closed
bigkraig wants to merge 1 commit intomasterfrom
service-annotations
Closed

Support a subset of annotations on the service resources#269
bigkraig wants to merge 1 commit intomasterfrom
service-annotations

Conversation

@bigkraig
Copy link

This should allow users to specify custom healthchecks per service and resolve #93.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 20.867% when pulling 7607db2 on service-annotations into 0ddcba1 on master.

# Ingress Resources
# Resources

This document covers how ingress resources work in relation to The ALB Ingress Controller.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ingress -> ingress and service

return a, nil
}

// ParseServiceAnnotations validates and loads all the annotations provided into the Annotations struct.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should mention it parses all annotations relevant to the service resource.

Also the annotations.ParseAnnotations should likely be refactored to annotations.ParseIngressAnnotations for consistency.

[or] you could combine these 2 functions as they're quite similar. Just needs to be smarter on which annotations to parse based on what's passed. I'm fine either way, as long as the intent of annotations.ParseServiceAnnotations vs annotations.ParseAnnotations is clear.

@joshrosso
Copy link

Minor changes requested. Spinning up a test cluster now to do some verification.

@joshrosso
Copy link

The only issue i've hit when testing the controller doesn't fallback on the ingress resource as they should.

For example, I've set my healthcheck-port to 8880. In the ingress resource.

$ kubectl get ing -n echoserver echoserver -o yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-interval-seconds: "30"
    alb.ingress.kubernetes.io/healthcheck-port: "8880"

But in AWS, it's still using the traffic port as seen below.

image

If I add this setting to the service, it will be respected.

apiVersion: v1
kind: Service
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-port: '8880'

image

But after removal from the service resource, even though that setting is still in the ingress resource, it goes back to the default (traffic port).

$ kubectl get -o yaml -n echoserver svc echoserver
apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"echoserver","namespace":"echoserver"},"spec":{"ports":[{"port":80,"protocol":"TCP","targetPort":8080}],"selector":{"app":"echoserver"},"type":"NodePort"}}
  creationTimestamp: 2017-11-18T00:33:17Z
  name: echoserver
  namespace: echoserver
  resourceVersion: "6811"
  selfLink: /api/v1/namespaces/echoserver/services/echoserver
  uid: 12541ce2-cbf8-11e7-8ebd-0aeebdf18292
spec:

image

Perhaps this is a small issue inside of the new annotations.Join?

@bigkraig
Copy link
Author

bigkraig commented Nov 18, 2017 via email

@rahulsen
Copy link

Why are we not simply specifying the custom healthcheck per targetGroup inside the ingress file itself ? Why the need to use an annotation from the service definition? Wont this be so much cleaner and intuitive like this:

#ingress yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: myIngress
  namespace: default
  annotations:
    alb.ingress.kubernetes.io/scheme: internal
spec:
  rules:
  - host: myhost.com
    http:
      paths:
      - path: /path1
        backend:
          serviceName: service1-stg
          servicePort: 8080
          healthCheckPath: /path1/health
      - path: /path2
        backend:
          serviceName: service2-stg
          servicePort: 9000
          healthCheckPath: /path2/health

@bigkraig
Copy link
Author

@rahulsen agreed, but its not supported in the ingress spec, i know they are looking at extending it

@bigkraig bigkraig closed this Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Health Checks do not work if using multiple pods on routes

4 participants