cetic / helm-nifi

Helm Chart for Apache Nifi
Apache License 2.0
215 stars 225 forks source link

cetic/helm-nifi NodePort Service spec.clusterIP cannot be "None" #16

Closed pinkdevelops closed 5 years ago

pinkdevelops commented 5 years ago

When trying to run cetic/helm-nifi locally (using Docker for Mac, and the integrated Kubernetes), if you change the service to be NodePort instead of ClusterIP, Helm throws and error when trying to install:

work-mbp-2:nifi-resources devin$ helm install --values nifi-values.yaml cetic-nifi cetic/nifi --namespace nifi-test Error: Service "cetic-nifi-headless" is invalid: spec.clusterIP: Invalid value: "None": may not be set to 'None' for NodePort services

This is the only part of values that I modified, I just changed the type to "NodePort", and LoadBalancer to false - I didn't adjust any of the other values:

service: headless: type: NodePort loadBalancer: enabled: false type: LoadBalancer httpPort: 80 httpsPort: 443 annotations: {}

loadBalancerIP:

Load Balancer sources

https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service

loadBalancerSourceRanges:

- 10.10.10.0/24

It looks like in the Service.yaml we have "clusterIP: None", has anyone has any luck using NodePort to access the NiFi UI on a local K8S cluster?

alexnuttinck commented 5 years ago

Hello @pinkdevelops,

You can setup the values.yaml to use NodePort, like this:

## Expose the nifi service to be accessed from outside the cluster (LoadBalancer service).
## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it.
## ref: http://kubernetes.io/docs/user-guide/services/
##
service:
  headless:
    type: ClusterIP
  loadBalancer:
    enabled: true
    type: NodePort
    httpPort: 80
    httpsPort: 443
    annotations: {}
    # loadBalancerIP:
    ## Load Balancer sources
    ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
    ##
    # loadBalancerSourceRanges:
    # - 10.10.10.0/24

I know this is a bit unintuitive and should be rework. I will create an issue for that.

pinkdevelops commented 5 years ago

Thanks @alexnuttinck , confirmed that this works!