Skip to content

Commit

Permalink
Merge pull request #69 from kubeslice/rc-v0.6.0
Browse files Browse the repository at this point in the history
feat(): Use local charts
  • Loading branch information
priyank-upadhyay authored Apr 23, 2024
2 parents 42b193f + 5a6faa1 commit 2abd051
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// "github.com/spf13/cobra/doc"
)

var version = "0.5.4"
var version = "0.6.0"
var rootCmd = &cobra.Command{
Use: "kubeslice-cli",
Version: version,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func validateConfiguration(specs *internal.ConfigurationSpecs) []string {
if hc.RepoAlias == "" {
errors = append(errors, fmt.Sprintf("%s configuration.helm_chart_configuration.repo_alias must be specified", util.Cross))
}
if hc.RepoUrl == "" {
if hc.RepoUrl == "" && !hc.UseLocal {
errors = append(errors, fmt.Sprintf("%s configuration.helm_chart_configuration.repo_url must be specified", util.Cross))
}
if hc.CertManagerChart.ChartName == "" {
Expand Down
1 change: 1 addition & 0 deletions pkg/internal/bootstrap-configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type HelmChartConfiguration struct {
HelmUsername string `yaml:"helm_username"`
HelmPassword string `yaml:"helm_password"`
ImagePullSecret ImagePullSecrets `yaml:"image_pull_secret"`
UseLocal bool `yaml:"use_local"`
}

type HelmChart struct {
Expand Down
20 changes: 12 additions & 8 deletions pkg/internal/helm-repo-add.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ imagePullSecrets:
func AddHelmCharts(ApplicationConfiguration *ConfigurationSpecs) {
hc := ApplicationConfiguration.Configuration.HelmChartConfiguration
// helm repo add avesha https://kubeslice.github.io/kubeslice/
util.Printf("\nAdding KubeSlice Helm Charts...")
if hc.UseLocal {
util.Printf("\nUsing Local Helm Charts...")
} else {
util.Printf("\nAdding KubeSlice Helm Charts...")

addHelmChart(ApplicationConfiguration)
util.Printf("%s Successfully added helm repo %s : %s", util.Tick, hc.RepoAlias, hc.RepoUrl)
time.Sleep(200 * time.Millisecond)
addHelmChart(ApplicationConfiguration)
util.Printf("%s Successfully added helm repo %s : %s", util.Tick, hc.RepoAlias, hc.RepoUrl)
time.Sleep(200 * time.Millisecond)

updateHelmChart()
util.Printf("%s Successfully updated helm repo", util.Tick)
time.Sleep(200 * time.Millisecond)
updateHelmChart()
util.Printf("%s Successfully updated helm repo", util.Tick)
time.Sleep(200 * time.Millisecond)

util.Printf("%s Successfully added helm charts.\n", util.Tick)
util.Printf("%s Successfully added helm charts.\n", util.Tick)
}
}

func addHelmChart(ApplicationConfiguration *ConfigurationSpecs) {
Expand Down
13 changes: 7 additions & 6 deletions samples/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ configuration:
project_name: #{the name of the KubeSlice Project}
project_users: #{optional: specify KubeSlice Project users with Readw-Write access. Default is admin}
helm_chart_configuration:
repo_alias: #{The alias of the helm repo for KubeSlice Charts}
repo_url: #{The URL of the Helm Charts for KubeSlice}
repo_alias: #{The alias of the helm repo for KubeSlice Charts. For local charts provide the local path to the charts.}
repo_url: #{The URL of the Helm Charts for KubeSlice. Not required if use_local is true}
use_local: #{Use local charts instead of remote charts. Default is false}
cert_manager_chart:
chart_name: #{The name of the Cert Manager Chart}
version: #{The version of the chart to use. Leave blank for latest version}
Expand All @@ -45,19 +46,19 @@ configuration:
worker_chart:
chart_name: #{The name of the Worker Chart}
version: #{The version of the chart to use. Leave blank for latest version}
values: #(Values to be passed as --set arguments to helm install)
values: #{Values to be passed as --set arguments to helm install}
ui_chart:
chart_name: #{The name of the UI/Enterprise Chart}
version: #{The version of the chart to use. Leave blank for latest version}
values: #(Values to be passed as --set arguments to helm install)
values: #{Values to be passed as --set arguments to helm install}
prometheus_chart:
chart_name: #{The name of the Prometheus Chart}
version: #{The version of the chart to use. Leave blank for latest version}
values: #(Values to be passed as --set arguments to helm install)
values: #{Values to be passed as --set arguments to helm install}
helm_username: #{Helm Username if the repo is private}
helm_password: #{Helm Password if the repo is private}
image_pull_secret: #{The image pull secrets. Optional for OpenSource, required for enterprise}
registry: #{The endpoint of the OCI registry to use. Default is `https://index.docker.io/v1/`}
username: #{The username to authenticate against the OCI registry}
password: #{The password to authenticate against the OCI registry}
email: #{The email to authenticate against the OCI registry}
email: #{The email to authenticate against the OCI registry}

0 comments on commit 2abd051

Please sign in to comment.