I seem to be running into a strange error when attempting to create an ingress resource with target-type ip. When I change the target-type to instance or remove the annotation altogether, ALB and Target group creation proceed without errors. My cluster is running version 1.0-beta.6 of the ALB Ingress controller on Amazon EKS.
Here is the relevant snippet from kubectl logs:
```I0821 16:35:40.370087 1 targetgroup.go:221] kube-system/stage-us-west-2-cluster1-a01-kube-system: Start TargetGroup creation.
E0821 16:35:40.370166 1 api.go:685] Failed request: elasticloadbalancing/CreateTargetGroup, Payload: { HealthCheckIntervalSeconds: 15, HealthCheckPath: "/health", HealthCheckPort: "traffic-port", HealthCheckProtocol: "HTTP", HealthCheckTimeoutSeconds: 5, HealthyThresholdCount: 2, Matcher: { HttpCode: "200" }, Name: "e2f84795-6825f822af2a82f5b0a", Port: 0, Protocol: "HTTP", TargetType: "ip", UnhealthyThresholdCount: 2, VpcId: "vpc-99d6e3e0"}, Error: InvalidParameter: 1 validation error(s) found.
My ingress definition is as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: stage-us-west-2-cluster1-a01-kube-system
annotations:
kubernetes.io/ingress.class: "alb"
external-dns.alpha.kubernetes.io/dns-type: "public"
alb.ingress.kubernetes.io/scheme: "internal"
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/success-codes: '200'
alb.ingress.kubernetes.io/target-type: 'ip'
alb.ingress.kubernetes.io/security-groups: '
alb.ingress.kubernetes.io/subnets: '
alb.ingress.kubernetes.io/certificate-arn: '
labels:
app: kube-system-lb
tier: kube-system
partition: a01
spec:
tls:
- hosts:
-
rules:
- host:
http:
paths:
- path: /
backend:
serviceName: cargo-repo-chartmuseum
servicePort: http
```
Apologies if this has been reported already. Also, happy to provide more information if required.
/assign @M00nF1sh
cc @bigkraig
I guess the problem is caused by using named string format targetPort in service spec(which is supported by kubernetes)
This this the code that causing problem, we need to find a way to convert named port to numeric port
@akshayks - can you send us your service specification in your manifest to confirm Yang's assertion?
@d-nishi My service has used a named port. Supporting @M00nF1sh's thoughts.
cool, I'll create an PR to fix this
@d-nishi @M00nF1sh Here is my service definition:
apiVersion: v1
kind: Service
metadata:
annotations:
alb.ingress.kubernetes.io/healthcheck-path: /health
labels:
app: chartmuseum
chart: chartmuseum-1.6.0
heritage: Tiller
release: cargo-repo
name: cargo-repo-chartmuseum
namespace: kube-system
spec:
externalTrafficPolicy: Cluster
ports:
- name: http
port: 8080
protocol: TCP
targetPort: http
selector:
app: chartmuseum
release: cargo-repo
type: NodePort
I can try modifying the service definition to eliminate the named port and see if that makes a difference.
I tried editing the service definition to use a numeric port and that seems to work with target type ip. This should be a reasonable work around until the controller can be modified to expect named ports.
Most helpful comment
@d-nishi @M00nF1sh Here is my service definition:
I can try modifying the service definition to eliminate the named port and see if that makes a difference.