2
votes

Here's my situation: I have deployed some k8s resources via docker stack liek this:

docker stack deploy --compose-file /path/to/docker-compose.yml mystack

docker stack services mystack

Now, I want to delete some of those resources, however, any resource I attempt to delete simply restarts itself immediately.

I have tried to delete the pods, corresponding replica sets, deployments and services but whatever resource I deleted, it restarted itself within a second.

What am I doing wrong?

1
How are you deleting the deployment? you should use: docker stack rmEran Chetzroni
Why can't I just use kubectl delete deployment <deployment_name> in order to, let's say, only remove a specific deployment?nymvno
I am not very fimiliar with docker stack, but it seems it keeps some kind of state, and makes sure everything is deployed, why not directly use kubectl for deploying the app in the first place?Eran Chetzroni
It was an attempt to deploy my docker-compose.yml without the necessity of re-writing all the stuff. Btw thanks! It worked with docker stack rmnymvno
It's the docker swarm. You can't use kubectl in a swarm. Also the purpose of docker service is to create the container, if deleted or stopped. Create a kubernetes cluster, deploy and then delete with kubectl.Prakash Krishna

1 Answers

4
votes

You should use docker stack to delete the stack

docker stack rm <stack-name>