GoogleCloudPlatform / continuous-deployment-on-kubernetes

Get up and running with Jenkins on Google Kubernetes Engine
Apache License 2.0
1.6k stars 890 forks source link

Error while creating ingress "googleapi: Error 400: Invalid value for field 'namedPorts[0].port" #100

Closed rsff closed 7 years ago

rsff commented 7 years ago

When trying the helm examples instead of using the proxy and the port forward I would like to expose them to a LB, the problem is when I try to expose them the following happens:

test) kubectl get svc --namespace jenkins
NAME               CLUSTER-IP      EXTERNAL-IP   PORT(S)     AGE
cd-jenkins         10.51.241.135   <none>        8080/TCP    1h
cd-jenkins-agent   10.51.240.101   <none>        50000/TCP   1h
test ) cat test.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  namespace: jenkins
spec:
  backend:
    serviceName: cd-jenkins
    servicePort: 8080
test ) kubectl describe ingress --namespace=jenkins
Name:                   test-ingress
Namespace:              jenkins
Address:
Default backend:        cd-jenkins:8080 (10.48.0.11:8080)
Rules:
  Host  Path    Backends
  ----  ----    --------
  *     *       cd-jenkins:8080 (10.48.0.11:8080)
Annotations:
Events:
  FirstSeen     LastSeen        Count   From                    SubObjectPath   Type            Reason  Message
  ---------     --------        -----   ----                    -------------   --------        ------  -------
  27m           27m             1       loadbalancer-controller                 Normal          ADD     jenkins/test-ingress
  27m           8m              20      loadbalancer-controller                 Warning         GCE     googleapi: Error 400: Invalid value for field 'namedPorts[0].port': '0'. Must be greater than or equal to 1, invalid

Thanks, RF

rsff commented 7 years ago

the svc needs to be NodePort type.