<p>I am using Apache Nifi on Kubernetes. I have deployed it and pods and service are working well.
It works well when I port forward my apache nifi service with :</p>
<pre><code>kubectl port-forward service/nifi-svc 8443:8443 -n mynamespace
</code></pre>
<p>But when I try to create an ingress with Traefik I have the error &quot;Internal server error&quot;.
Here is my yaml for ingress:</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: nifi-ingress
  namespace: mynamespace
spec:
  entryPoints:
    - websecure
  routes:
  - kind: Rule
    match: Host(`XXX`)
    services:
    - name: nifi-svc 
      port: 8443
  tls: {}
</code></pre>
<p><strong>I don't know where I am wrong in my yaml file for ingress.</strong></p>
<p><em><strong>UPDATE BELOW WITH YAML files I did</strong></em></p>
<p>To deploy the pods I did this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ingress-tests-nifi
  namespace: mynamespace
  labels:
    name : ingress-tests-nifi
    app : ingress-tests-nifi
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: ingress-tests-nifi
  template:
    metadata:
      labels:
        app: ingress-tests-nifi
    spec:
      restartPolicy: Always
      containers:
      - name: nifi2
        image: XXX
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: nifi2
        env:
        - name: &quot;NIFI_SENSITIVE_PROPS_KEY&quot;
          value: &quot;XXX&quot;
        - name: ALLOW_ANONYMOUS_LOGIN
          value: &quot;no&quot;
        - name: SINGLE_USER_CREDENTIALS_USERNAME 
          value: XXX
        - name: SINGLE_USER_CREDENTIALS_PASSWORD 
          value: XXX
        - name: NIFI_WEB_HTTPS_HOST
          value: &quot;0.0.0.0&quot;
        - name: NIFI_WEB_HTTPS_PORT
          value: &quot;8443&quot;
        - name: NIFI_WEB_PROXY_HOST
          value: 0.0.0.0:8443
        - name: HOSTNAME
          value: &quot;nifi1&quot;
        - name: NIFI_ANALYTICS_PREDICT_ENABLED
          value: &quot;true&quot;
        - name: NIFI_ELECTION_MAX_CANDIDATES
          value: &quot;1&quot;
        - name: NIFI_ELECTION_MAX_WAIT
          value: &quot;20 sec&quot;
        - name: NIFI_JVM_HEAP_INIT
          value: &quot;1g&quot;
        - name: NIFI_JVM_HEAP_MAX
          value: &quot;1g&quot;
        volumeMounts:
          - name: pv-XXX
            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
            ephemeral-storage: 1Gi
            memory: 1Gi
          limits:
            cpu: 500m
            ephemeral-storage: 1Gi
            memory: 1Gi
      imagePullSecrets:
      - name: depot-secret
      volumes:
        - name: pv-XXX
          persistentVolumeClaim:
            claimName: pv-XXX
</code></pre>
<p>And for the service yaml I did this:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: ingress-tests-nifi-svc
  namespace: mynamespace
spec:
  selector:
    app: ingress-tests-nifi
  ports:
  - port: 8443
    protocol: TCP
    targetPort: 8443
</code></pre>

lbened
<p>Check if the ingress host is present in the nifi.web.proxy.host property in the nifi.properties file. If your nifi is secured, appropriate certificates must be set up (the ingress host and nifi must trust each other).</p>
<p>Checking the nifi logs for the exception might help. Check any of app-log.log, nifi-bootstrap.log and nifi-user.log . They are usually in ${NIFI_HOME}/logs/ in your container.</p>
