I have Apache Nifi working in Kubernetes. I have deployed it with yaml file. I have several Python scripts I would like to call on Apache Nifi.
I used this yaml file to deploy Apache Nifi:
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nifi
namespace: test-namespace
labels:
name : test-nifi
app : test-nifi
spec:
replicas: 2
strategy:
type: Recreate
selector:
matchLabels:
app: test-nifi
template:
metadata:
labels:
app: test-nifi
spec:
restartPolicy: Always
containers:
- name: nifi1
image: XXX
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: nifi1
env:
- name: "NIFI_SENSITIVE_PROPS_KEY"
value: "..."
- name: ALLOW_ANONYMOUS_LOGIN
value: "no"
- name: SINGLE_USER_CREDENTIALS_USERNAME
value: XXX
- name: SINGLE_USER_CREDENTIALS_PASSWORD
value: XXX
- name: NIFI_WEB_HTTPS_HOST
value: "0.0.0.0"
- name: NIFI_WEB_HTTPS_PORT
value: "8443"
- name: NIFI_WEB_PROXY_HOST
value: 0.0.0.0:8443
- name: HOSTNAME
value: "nifi1"
- name: NIFI_ANALYTICS_PREDICT_ENABLED
value: "true"
- name: NIFI_ELECTION_MAX_CANDIDATES
value: "1"
- name: NIFI_ELECTION_MAX_WAIT
value: "20 sec"
- name: NIFI_JVM_HEAP_INIT
value: "3g"
- name: NIFI_JVM_HEAP_MAX
value: "4g"
volumeMounts:
- name: pv-01
mountPath: /opt/nifi/nifi-current/data
subPath: data
livenessProbe:
exec:
command:
- pgrep
- java
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8443
initialDelaySeconds: 240
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
resources:
requests:
cpu: 400m
memory: 4Gi
limits:
cpu: 500m
memory: 4Gi
imagePullSecrets:
- name: repo-secret
volumes:
- name: pv-01
persistentVolumeClaim:
claimName: pv-01-claim
Solution I have :
- Inject these scripts as config maps, this way the Apache Nifi container will have access to scripts.
How can I do it with config maps ?