Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NiFi cluster hostname #26

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployment/nifi-ssl-configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data:
then
echo "Creating keystore"
keytool -genkey -noprompt -alias nifi-keystore \
-dname "CN=SA,OU=${ORGANISATION_UNIT},O=${ORGANISATION},L=${CITY},S=${STATE},C=${COUNTRY_CODE}" \
-dname "CN=${HOSTNAME},OU=${ORGANISATION_UNIT},O=${ORGANISATION},L=${CITY},S=${STATE},C=${COUNTRY_CODE}" \
-keystore ${NIFI_HOME}/keytool/keystore.p12 \
-storepass ${KEYSTORE_PASS:-$NIFI_SENSITIVE_PROPS_KEY} \
-KeySize 2048 \
Expand All @@ -40,7 +40,7 @@ data:
then
echo "Creating truststore"
keytool -genkey -noprompt -alias nifi-truststore \
-dname "CN=SA,OU=${ORGANISATION_UNIT},O=${ORGANISATION},L=${CITY},S=${STATE},C=${COUNTRY_CODE}" \
-dname "CN=${HOSTNAME},OU=${ORGANISATION_UNIT},O=${ORGANISATION},L=${CITY},S=${STATE},C=${COUNTRY_CODE}" \
-keystore ${NIFI_HOME}/keytool/truststore.jks \
-storetype jks \
-keypass ${KEYSTORE_PASS:-$NIFI_SENSITIVE_PROPS_KEY} \
Expand Down
32 changes: 20 additions & 12 deletions deployment/nifi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spec:
spec:
automountServiceAccountToken: false
enableServiceLinks: false
setHostnameAsFQDN: true
dnsPolicy: ClusterFirstWithHostNet
restartPolicy: Always
securityContext:
runAsGroup: 1000
Expand Down Expand Up @@ -74,26 +76,32 @@ spec:
- containerPort: 6342
name: cluster-lb
env:
- name: NIFI_WEB_HTTP_HOST
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NIFI_CLUSTER_NODE_ADDRESS
fieldPath: status.podIP # Use pod ip
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NIFI_REMOTE_INPUT_HOST
fieldPath: metadata.name # Use pod name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: status.podIP
fieldPath: metadata.namespace # Use pod namespace
- name: NIFI_UI_BANNER_TEXT
value: $(POD_NAME) # Use pod name for banner
- name: NIFI_WEB_HTTP_HOST
value: $(POD_NAME).nifi.$(POD_NAMESPACE).svc.cluster.local # Use pod fqdn as web host
- name: NIFI_CLUSTER_NODE_ADDRESS
value: $(POD_NAME).nifi.$(POD_NAMESPACE).svc.cluster.local # Use pod fqdn as node address
- name: NIFI_REMOTE_INPUT_SOCKET_HOST
value: $(POD_NAME).nifi.$(POD_NAMESPACE).svc.cluster.local # Use pod fqdn as input socket address
- name: NIFI_REMOTE_INPUT_HOST
value: $(POD_NAME).nifi.$(POD_NAMESPACE).svc.cluster.local # Use pod fqdn as input host address
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: status.podIP
value: $(POD_IP) # Use pod ip as hostname
- name: NODE_IDENTITY
valueFrom:
fieldRef:
fieldPath: metadata.name
value: $(POD_NAME) # Use pod name as identity
envFrom:
- configMapRef:
name: nifi-cm
Expand Down
2 changes: 2 additions & 0 deletions deployment/zookeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spec:
spec:
automountServiceAccountToken: false
enableServiceLinks: false
setHostnameAsFQDN: true
dnsPolicy: ClusterFirstWithHostNet
restartPolicy: Always
securityContext:
runAsGroup: 1000
Expand Down