How to start an Ingress Controller with flags? (microk8s)

1/25/2022

Usually i am able to find most things by searching on the web - however in this case, the instructions on the web talk about - probably very basic stuff that i don't get yet.

What i am trying to achieve: i am trying to install argocd, using microk8s and nginx-ingress. Right now i am stuck at enabling the SSL passthrough for argocd. Currently i configured an ingress-controller according to the instructions of the argocd-documentation and the ingress-controller runs without errors.

My guess is that as it's mentioned everywhere that i have to start the ingress controller with the "--enable-ssl-passthrough"-flag.

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#ssl-passthrough "SSL Passthrough is disabled by default and requires starting the controller with the --enable-ssl-passthrough flag."

Now my problem: How do i do that? - for me, the ingress controller is "just always running". I can delete and recreate the controller with the kubectl-command "create -f ingress.yaml" - which creates an ingress within the argocd-namespace.

i kind of lack the basics of kubernetes and don't get how i could stop and restart the ingress-controller with flags (perhaps i mistake what the "ingress controller" is too). Does anyone have an idea how i could achieve that?

I am running microk8s v1.23.1 on Ubuntu 18.04.3 LTS

-- apro
argocd
kubernetes
kubernetes-ingress
microk8s
nginx-ingress

1 Answer

1/25/2022

If you can edit deployment YAML config to pass argument like

kubectl edit deployment <Nginx ingress controller deployment name> -n <namespace-name- in which Nginx is there> -o yaml

you can edit the YAML of the controller like

containers:
    - name: nginx-ingress-controller
      image: <IMAGE of Nginx>
      args:
        - --enable-ssl-passthrough

Ingress annotation if you want to add

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    #LIST OF ANNOTATION YOU CAN ADD
    nginx.ingress.kubernetes.io/secure-backends: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx-example
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
-- Harsh Manvar
Source: StackOverflow