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

Unable to Uninstall Garden Services From a Cluster #1245

Closed
D-Dinh opened this issue Oct 2, 2019 · 2 comments · Fixed by #1373
Closed

Unable to Uninstall Garden Services From a Cluster #1245

D-Dinh opened this issue Oct 2, 2019 · 2 comments · Fixed by #1373
Assignees
Labels
bug priority:low Low priority issue or feature

Comments

@D-Dinh
Copy link

D-Dinh commented Oct 2, 2019

Bug

Current Behavior

When attempting to uninstall garden services from a cluster as documented:
https://docs.garden.io/using-garden/remote-kubernetes

garden --env= plugins kubernetes uninstall-garden-services

The following happens:

Removing cluster-wide services for dev environment ⚙️

✔ providers                 → Getting status... → Done
 Deleting services...
    build-sync                → Deleting...
    default-backend           → Deleting...
    docker-daemon             → Deleting...
    docker-registry           → Deleting...
    ingress-controller        → Deleting...
    nfs-provisioner           → Deleting...
    kubernetes-dashboard      → Deleting...
    registry-proxy            → Deleting...
Error: Command failed with exit code 1 (EPERM)...

Error.log

[2019-10-01T23:40:05.621Z] Error: Command failed with exit code 1 (EPERM): $USER_HOME/.garden/tools/helm/1c6ed8021f49d4ce/darwin-amd64/helm --tiller-namespace garden-system --kube-context kubernetes template --name garden-registry-proxy --namespace garden-system --values /Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy/garden-values.yml /Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy

Error: no Chart.yaml exists in directory "/Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy"
    at makeError (/snapshot/dist/node_modules/execa/lib/error.js:58:11)
    at handlePromise (/snapshot/dist/node_modules/execa/index.js:112:26)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error Details:
command: >-
  $USER_HOME/.garden/tools/helm/1c6ed8021f49d4ce/darwin-amd64/helm
  --tiller-namespace garden-system --kube-context kubernetes template --name
  garden-registry-proxy --namespace garden-system --values
  /Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy/garden-values.yml
  /Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy
exitCode: 1
exitCodeName: EPERM
stdout: ''
stderr: >-
  Error: no Chart.yaml exists in directory
  "/Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy"
all: >-
  Error: no Chart.yaml exists in directory
  "/Sandbox/git/my-service/.garden/kubernetes.garden/build/registry-proxy"
failed: true
timedOut: false
isCanceled: false
killed: false

Expected behavior

Garden services and all garden system specific namespaces removed (e.g.garden-system and garden-system--metadata).

Reproducible example

Install garden services to a cluster: garden plugins kubernetes cluster-init
Uninstall garden services from the cluster: garden plugins kubernetes uninstall-garden-services

Your environment

Garden Versions Affected:

  • 0.10.6
  • 0.10.11
kubectl version:
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-19T13:57:45Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.10-eks-825e5d", GitCommit:"825e5de08cb05714f9b224cd6c47d9514df1d1a7", GitTreeState:"clean", BuildDate:"2019-08-18T03:58:32Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
@10ko 10ko added the bug label Oct 2, 2019
@10ko 10ko assigned thsig and 10ko Oct 2, 2019
@edvald edvald assigned edvald and unassigned thsig and 10ko Oct 10, 2019
@edvald edvald added the priority:low Low priority issue or feature label Oct 10, 2019
@edvald
Copy link
Collaborator

edvald commented Oct 10, 2019

At first glance, I can only reproduce this if I delete the .garden directory between running cluster-init and uninstall-garden-services. Otherwise it appears to work as expected.

This is basically an issue with the helm module type, where the delete handler doesn't work if the module hasn't been built. Lowering the priority, but should still be easy and quick to fix.

@garoose
Copy link

garoose commented Nov 7, 2019

This is basically an issue with the helm module type, where the delete handler doesn't work if the module hasn't been built. Lowering the priority, but should still be easy and quick to fix.

This is a slightly bigger issue for us. We run our garden tests with CI on a regular interval in a persistent environment where sometimes nothing has changed and the tests don't actually need to run. This means the namespace is created, but none of the services are deployed. Then when we try to delete the garden environment with garden delete env, it fails in this same way. Our workaround is to kubectl delete the namepsace after just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority:low Low priority issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants