Giter Club home page Giter Club logo

Comments (4)

fyrnaga avatar fyrnaga commented on June 16, 2024

From what we gather it seems to happen when only there is a helm chart using Kubernetes CRDs which are not installed. It keeps looping without any error being returned

from helm.

gjenkins8 avatar gjenkins8 commented on June 16, 2024

can you please repeat with --debug flag, and see if anything useful is returned. And for brevity, provide commands how to replicate

from helm.

Fenil-Patelll avatar Fenil-Patelll commented on June 16, 2024

@fyrnaga

from helm.

fyrnaga avatar fyrnaga commented on June 16, 2024

@gjenkins8 To explain a bit more, we have a client app called helmet to wrap helm calls over http. This allows use to do helm installation on Kubernetes cluster through our app using that client.

Right now, the problem occurs if we have an empty kubernetes cluster (like a docker one locally) without anything. When we try to install either

  • traefik/traefik
    or
  • prometheus-community/kube-Prometheus-stack
    it is hanging in the Run command.

We did a debugging session in visual studio and it is looping almost infinitely when the custom CRDs are not installed.

There is the code sample. It is hanging in the Run command.

type installRequest struct {
	baseRequest
	DryRun      bool                   `json:"dryRun,omitempty"`
	Chart       string                 `json:"chart"`
	Version     string                 `json:"version"`
	RepoURL     string                 `json:"repositoryUrl"`
	ReleaseName string                 `json:"releaseName"`
	Values      map[string]interface{} `json:"values,omitempty"`
}

// InstallChart attempts to execute a Helm release on the target
// Kubernetes server with the values supplied in the request body
func InstallChart(r *http.Request) response.APIResponse {

	req := new(installRequest)
	if validateReq := validateRequest(r, req); validateReq != nil {
		return validateReq
	}

	namespace := mux.Vars(r)["namespace"]
	actionConfig, apiErr := req.InitActionConfig(namespace)
	if apiErr != nil {
		return apiErr
	}

	installClient := action.NewInstall(actionConfig)
	installClient.DryRun = req.DryRun
	installClient.ReleaseName = req.ReleaseName
	installClient.Namespace = namespace

	// creates new environmentSettings objects, if no environment
	// variables are found it pre-populates with defaults
	settings := cli.New()
	installClient.ChartPathOptions.RepoURL = req.RepoURL
	installClient.ChartPathOptions.Version = req.Version

	cp, err := installClient.ChartPathOptions.LocateChart(req.Chart, settings)
	if err != nil {
		return response.FailureResponseWithContext(404, response.ErrNotFound, map[string]string{"chart": req.Chart}, err)
	}

	loadedChart, err := loader.Load(cp)
	if err != nil {
		return response.FailureResponse(500, response.ErrUnexpected, err)

	}
	rel, err := installClient.Run(loadedChart, req.Values)
	if err != nil {
		// In the event of an error during the install step we return the error message in the context map as is, this is a because
		// these are always printed in the CLI tool and give the user important feedback about why the failure occured
		return response.FailureResponseWithContext(500, response.ErrUnexpected, map[string]string{"message": err.Error()}, err)
	}
	return response.SuccessResponse(200, rel)
}

There are the http call values received. We are using for either chart the default value file that is provided.
image

I tried to have the debug flag enabled but it didn't added anything.

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.