I am trying to run a .NET Core
console app on Kubernetes
which should be kept alive with a Console.ReadLine
.
Docker
image is being run with a kubectl apply -f ....yaml
command. Is there a way to run this command sort of interactively, forcing it now to close?
I did not find anything useful with the kubectl apply --help
command.
If there is no way of doing this, what would be the best alternative? Running a CMD on the deployment yaml
? I would rather not do an infite loop. There must be a better solution
Not that I am very proud of the Console.WriteLine
way of doing it..
UPDATE:
Until I find a better solution, I implemented the following solution
Does it make sense to run a c# worker service in docker?
which is an infinite loop. Tested it and works on Kubernetes
.