Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl run is deprecated with deployment generator #16

Closed
abdennour opened this issue Dec 19, 2018 · 1 comment
Closed

kubectl run is deprecated with deployment generator #16

abdennour opened this issue Dec 19, 2018 · 1 comment

Comments

@abdennour
Copy link

abdennour commented Dec 19, 2018

Here, you put this answer:

kubectl run nginx --image=nginx:1.7.8 --replicas=2 --port=80

Since kubeclt run is now deprecated with deployments, this is the alternative:

kubectl create deployment nginx  --image=nginx:1.7.8  --dry-run -o yaml | sed 's/replicas: 1/replicas: 2/g'  | sed 's/image: nginx:1.7.8/image: nginx:1.7.8\n        ports:\n        - containerPort: 80/g' | kubectl apply -f -

Unfortunately, kubectl create does not support --replicas nor --port. That's why the alternative was too long 😁

I will open PR or anyone can open it.
Thanks!

dgkanatsios added a commit that referenced this issue Dec 28, 2018
@dgkanatsios
Copy link
Owner

Pushed with info about deprecation and a couple of alternative solutions, including yours. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants