You cannot just deploy a swarm to Kubernetes. You will need to translate the Docker compose files to Kubernetes deployments. If that is done correctly lables, secrets, etc should be available in Kubernetes.
However you will probably need to adjust the code for your custom ingress controller as this highly depends on the Kubernetes API. A proper ingress controller will query the Kubernetes API for Services, Ingresses and Secrets and listen for changes. Check this blog on detailed instructions.
However I would recommend to check the list of available ingress controllers before trying to develop a custom ingress controller.