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

kompose up/down create and delete pvc #220

Merged
merged 1 commit into from
Oct 22, 2016

Conversation

surajssd
Copy link
Member

pvc will be parsed when passing objects via kube client to create various objects. Also while deleting pvc will be deleted.

Fixes #218

@dustymabe
Copy link
Contributor

was trying to test this for openshift but seems like this change is only for kube - should we update both at the same time?

@dustymabe
Copy link
Contributor

also managed to get this error - but not sure where it came from:

[dustymabe@media examples (dusty-mlbparks)]$ ../kompose up
We are going to create Kubernetes deployments and services for your Dockerized application. 
If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. 

INFO[0000] Successfully created service: redis          
INFO[0000] Successfully created service: web            
INFO[0000] Successfully created deployment: redis       
INFO[0000] Successfully created deployment: web         

Your application has been deployed to Kubernetes. You can run 'kubectl get deployment,svc,pods' for details.
[dustymabe@media examples (dusty-mlbparks)]$ ../kompose down 
INFO[0000] Successfully deleted service: redis          
INFO[0003] Successfully deleted deployment: redis       
FATA[0003] Error while deleting application: no reaper has been implemented for { PersistentVolumeClaim}

@surajssd
Copy link
Member Author

@dustymabe sorry for not labeling it, so creating a PVC was easy thing to do, but looking at how can I delete it, it's not straightforward like other objects, so stuck on it right now, so mostly following code from kubectl

@surajssd surajssd force-pushed the pvc-kompose-up branch 2 times, most recently from 8720532 to 8b3bad6 Compare October 20, 2016 14:32
@surajssd
Copy link
Member Author

So I need some review here with respect to how Undeploy is implemented, I feel even for undeploy we should get converted objects iterate on those and then type switch on it and delete objects, cleanly. The problem here is that with komposeObject there is no way to identify how many PVCs were created? And since the names of PVC follow index starting from 0. There is no easy way to understand their names. So I propose here to change current implementation to implementation similar to Deploy its just that instead of create we call delete.

@dustymabe
Copy link
Contributor

hey suraj - this is working for openshift now :) - one thing though. should we modify the following line to include pvc for both kube and openshift?

Your application has been deployed to OpenShift. You can run 'oc get dc,svc,is' for details.

@surajssd
Copy link
Member Author

@dustymabe sure done for k8s as well! That's nice catch!

Never mind #220 (comment) check latest changes!

@dustymabe
Copy link
Contributor

Never mind #220 (comment) check latest changes!

so you figured out how to go about doing the undeploy?

@surajssd
Copy link
Member Author

@dustymabe
Copy link
Contributor

up/down seems to be working for me now. I'm good with this - just need a maintainer to review.

@dustymabe
Copy link
Contributor

ping @ngtuna @janetkuo @kadel

@ngtuna
Copy link
Contributor

ngtuna commented Oct 20, 2016

Code LGTM. Haven't tested yet but @dustymabe did it.

Copy link
Member

@kadel kadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add one small comment explaining TIMEOUT const. Otherwise LGTM 👍
Great work @surajssd

)

type Kubernetes struct {
}

const TIMEOUT = 300
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add comment explaining what where this timeout is used or what is it for?

pvc will be parsed when passing objects via kube client
to create various objects.
Also while deleting pvc will be deleted.

Fixes kubernetes#218
@surajssd
Copy link
Member Author

@surajssd surajssd merged commit aea39b4 into kubernetes:master Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants