Closed kibbles-n-bytes closed 6 years ago
This is beautiful! What about "delete"?
I just submitted a PR that makes deletion of k8s resouces also idempotent, though there is some non-idempotent gcloud-specific stuff still, so the sc
commands aren't yet there. :sweat_smile:
Cool, thank you!
Another question is, the idempotency will only be kept within the one single kubectl command, right? There are more than one deployment happened in sc install
and no matter which one fails, the installation will fail and we need to clean up namespace "service-catalog". I am not sure if this PR addresses that.
Yeah, there still is work to be done to clean up after failed installs. This will only make sure that runs in the past won't affect future successes.
kubectl apply -f $FILENAME
is the recommended way to declaratively create and manage k8s resources via configuration templates. It also is handy in that it is idempotent!NOTE: Technically, you should only do
kubectl apply
from the very beginning, and it is not recommended to be mixed withkubectl create
. However, I tested on my 1.8 cluster and it has had no side effects. If on the slight chance there's a problem, deleting and re-adding Service Catalog and the GCP broker viasc
will 100% fix the issue. And anyone usingsc
on a fresh cluster would be onlyapply
ing from the very beginning.Fixes: #142