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

Does the client supports create and run a particular image in a pod operation #2284

Closed
sjmittal opened this issue Jun 12, 2020 · 3 comments · Fixed by #2433
Closed

Does the client supports create and run a particular image in a pod operation #2284

sjmittal opened this issue Jun 12, 2020 · 3 comments · Fixed by #2433
Assignees
Labels

Comments

@sjmittal
Copy link

I wanted to know if there is any method or api which can support an operation like:
kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...]
using the the Kubernetes client.

I was going through the examples but I could not find any.

@sjmittal sjmittal changed the title Does the client supports create and run a particular image in a pod. Does the client supports create and run a particular image in a pod operation Jun 12, 2020
@rohanKanojia
Copy link
Member

I don't think we have anything like kubectl run right now. But implementing it should not be that hard. You just need to create a Deployment with the required image, and port values.

@manusa
Copy link
Member

manusa commented Jun 19, 2020

I think kubectl run creates a Pod (no Deployment involved)

@manusa manusa added the feature label Jun 19, 2020
@rohanKanojia
Copy link
Member

Umm, yeah. Seems like you're right. Old behavior is to create deployment but I see that that's been marked as deprecated:

~/work/repos/jkube : $ kubectl run nginx --image=nginx --replicas=1 
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/nginx created
~/work/repos/jkube : $ kubectl get all
NAME                         READY   STATUS              RESTARTS   AGE
pod/nginx-6db489d4b7-qkwt7   0/1     ContainerCreating   0          4s
pod/nginx-6db489d4b7-x9dkq   0/1     Terminating         0          36s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   6m1s

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nginx   0/1     1            0           4s

NAME                               DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-6db489d4b7   1         1         0       4s
~/work/repos/jkube : $ kubectl run nginx --generator=run-pod/v1 --image=nginx --replicas=1 
pod/nginx created
~/work/repos/jkube : $ 

@rohanKanojia rohanKanojia self-assigned this Aug 21, 2020
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 24, 2020
…Pod operation

Add support for client.run() with which we should be able to create
Pod/Deployments just based on few parameters. For example, creating
a simple pod should be like:

client.run().pods().withName("nginx").withImage("nginx:1.39").done()
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 25, 2020
…Pod operation

Add support for client.run() with which we should be able to create
Pod/Deployments just based on few parameters. For example, creating
a simple pod should be like:

client.run().pods().withName("nginx").withImage("nginx:1.39").done()
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 25, 2020
…Pod operation

Add support for client.run() with which we should be able to create
Pod/Deployments just based on few parameters. For example, creating
a simple pod should be like:

client.run().pods().withName("nginx").withImage("nginx:1.39").done()
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 25, 2020
…Pod operation

Add support for client.run() with which we should be able to create
Pod/Deployments just based on few parameters. For example, creating
a simple pod should be like:

client.run().pods().withName("nginx").withImage("nginx:1.39").done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants