Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
correct service definition #17
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Dec 9, 2019
1 parent 4a97f6d commit 74c5980
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 65 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,17 @@ The following table lists the configurable parameters of the nifi chart and the
| `auth.ldap.searchFilter` | ldap searchFilter | `CN=john` |
| **postStart** |
| `postStart` | Include additional libraries in the Nifi containers by using the postStart handler | `nil` |
| **Service** |
| `service.headless.type` | Type of the headless service for nifi | `ClusterIP` |
| `service.loadBalancer.enabled` | Enable the LoadBalancerIP service | `true` |
| `service.loadBalancer.type` | Type of the LoadBalancerIP service for nifi | `LoadBalancer` |
| `service.loadBalancer.httpPort` | Port to expose service | `80` |
| `service.loadBalancer.httpsPort` | Port to expose service in tls | `443` |
| `service.loadBalancer.annotations` | Service annotations | `{}` |
| `service.loadBalancer.loadBalancerIP` | LoadBalancerIP if service type is `LoadBalancer` | `nil` |
| `service.loadBalancer.loadBalancerSourceRanges` | Address that are allowed when svc is `LoadBalancer` | `[]` |
| **Headless Service** |
| `headless.type` | Type of the headless service for nifi | `ClusterIP` |
| `headless.annotations` | Headless Service annotations | `{service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"}
`|
| **UI Service** |
| `service.type` | Type of the UI service for nifi | `LoadBalancer` |
| `service.httpPort` | Port to expose service | `80` |
| `service.httpsPort` | Port to expose service in tls | `443` |
| `service.annotations` | Service annotations | `{}` |
| `service.loadBalancerIP` | LoadBalancerIP if service type is `LoadBalancer` | `nil` |
| `service.loadBalancerSourceRanges` | Address that are allowed when svc is `LoadBalancer` | `[]` |
| **Ingress** |
| `ingress.enabled` | Enables Ingress | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
Expand Down
10 changes: 1 addition & 9 deletions templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
Cluster endpoint IP address will be available at:
{{- if .Values.service.loadBalancer.enabled }}
kubectl get svc {{ .Release.Name }}-apache-nifi-load-balancer -n {{ .Release.Namespace }} -o jsonpath='{.status.loadBalancer.ingress[*].ip}'
{{- else }}
{{- if .Values.sts.hostPort }}
kubectl get nodes -o jsonpath='{.items[*].status.addresses[].address}'
{{- else }}
Unavailable (need to specify loadBalancer or hostPort for the nifi container)
{{- end }}
{{- end }}
kubectl get svc {{ .Release.Name }} -n {{ .Release.Namespace }} -o jsonpath='{.status.loadBalancer.ingress[*].ip}'

Cluster endpoint domain name is: {{.Values.properties.webProxyHost}} - please update your DNS or /etc/hosts accordingly!

Expand Down
64 changes: 32 additions & 32 deletions templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "apache-nifi.fullname" . }}-headless
labels:
app: {{ include "apache-nifi.name" . | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: {{ template "apache-nifi.fullname" . }}-headless
labels:
app: {{ include "apache-nifi.name" . | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
{{- if .Values.headless.annotations }}
annotations:
{{ toYaml .Values.headless.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.service.headless.type }}
clusterIP: None
ports:
type: {{ .Values.headless.type }}
clusterIP: None
ports:
{{- if .Values.properties.clusterSecure }}
- port: {{ .Values.properties.httpsPort }}
name: https
- port: {{ .Values.properties.httpsPort }}
name: https
{{- else}}
- port: {{ .Values.properties.httpPort }}
name: http
- port: {{ .Values.properties.httpPort }}
name: http
{{- end }}
- port: {{ .Values.properties.clusterPort }}
name: cluster
selector:
app: {{ include "apache-nifi.name" . | quote }}
release: {{ .Release.Name | quote }}
- port: {{ .Values.properties.clusterPort }}
name: cluster
selector:
app: {{ include "apache-nifi.name" . | quote }}
release: {{ .Release.Name | quote }}
---
{{- if .Values.service.loadBalancer.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -37,32 +38,31 @@ metadata:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
{{- if .Values.service.loadBalancer.annotations }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.loadBalancer.annotations | indent 4 }}
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.service.loadBalancer.type }}
{{- if .Values.service.loadBalancer.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancer.loadBalancerIP }}
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.loadBalancer.loadBalancerSourceRanges }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ with .Values.service.loadBalancer.loadBalancerSourceRanges }}
{{ with .Values.service.loadBalancerSourceRanges }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
ports:
{{- if .Values.properties.clusterSecure }}
- port: {{ .Values.service.loadBalancer.httpsPort }}
- port: {{ .Values.service.httpsPort }}
name: https
targetPort: {{ .Values.properties.httpsPort }}
targetPort: {{ .Values.httpsPort }}
{{- else }}
- port: {{ .Values.service.loadBalancer.httpPort }}
- port: {{ .Values.service.httpPort }}
name: http
targetPort: {{ .Values.properties.httpPort }}
{{- end }}
selector:
app: {{ template "apache-nifi.name" . }}
release: {{ .Release.Name }}
{{- end }}
34 changes: 19 additions & 15 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Number of nifi nodes
replicaCount: 2
replicaCount: 1

## Set default image, imageTag, and imagePullPolicy.
## ref: https://hub.docker.com/r/apache/nifi/
Expand Down Expand Up @@ -69,21 +69,25 @@ auth:
## 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/
##

# headless service
headless:
type: ClusterIP
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"

# ui service
service:
headless:
type: ClusterIP
loadBalancer:
enabled: true
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
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

## Configure Ingress based on the documentation here: https://kubernetes.io/docs/concepts/services-networking/ingress/
##
Expand Down

0 comments on commit 74c5980

Please sign in to comment.