Skip to content

Commit

Permalink
Merge pull request #408 from keel-hq/feature/tiller_address_env
Browse files Browse the repository at this point in the history
Feature/tiller address env
  • Loading branch information
rusenask authored Jun 14, 2019
2 parents ffcb198 + 75fdcd5 commit 743309d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion chart/keel/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: keel
description: Open source, tool for automating Kubernetes deployment updates. Keel is stateless, robust and lightweight.
version: 0.8.9
version: 0.8.10
# Note that we use appVersion to get images tag, so make sure this is correct.
appVersion: 0.14.3-rc1
keywords:
Expand Down
2 changes: 2 additions & 0 deletions chart/keel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: "1"
- name: TILLER_NAMESPACE
value: "{{ .Values.helmProvider.tillerNamespace }}"
- name: TILLER_ADDRESS
value: "{{ .Values.helmProvider.tillerAddress }}"
{{- end }}
{{- if .Values.gcr.enabled }}
# Enable GCR with pub/sub support
Expand Down
4 changes: 4 additions & 0 deletions chart/keel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ polling:
helmProvider:
enabled: true
tillerNamespace: "kube-system"
# optional Tiller address (if portforwarder tunnel doesn't work),
# if you are using default configuration, setting it to
# 'tiller-deploy.tiller.svc.cluster.local:44134' is usually fine
tillerAddress: ''

# Google Container Registry
# GCP Project ID
Expand Down
30 changes: 17 additions & 13 deletions cmd/keel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,28 @@ func setupProviders(opts *ProviderOpts) (providers provider.Providers) {

if os.Getenv(EnvHelmProvider) == "1" || os.Getenv(EnvHelmProvider) == "true" {

var tillerAddr string

if os.Getenv(EnvHelmTillerAddress) != "" {
log.Warnf("Environment variable %s is deprecated, use %s environment variable to set tiller's namespace (defaults to 'kube-system')", EnvHelmTillerAddress, EnvHelmTillerNamespace)
}
tillerAddr = os.Getenv(EnvHelmTillerAddress)
log.Infof("Tiller address specified: %s", tillerAddr)
} else {
tillerNamespace := "kube-system"
if os.Getenv(EnvHelmTillerNamespace) != "" {
tillerNamespace = os.Getenv(EnvHelmTillerNamespace)
}

tillerNamespace := "kube-system"
if os.Getenv(EnvHelmTillerNamespace) != "" {
tillerNamespace = os.Getenv(EnvHelmTillerNamespace)
}
tillerTunnel, err := portforwarder.New(tillerNamespace, opts.k8sClient, opts.config)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Fatal("failed to setup Tiller tunnel")
}

tillerTunnel, err := portforwarder.New(tillerNamespace, opts.k8sClient, opts.config)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Fatal("failed to setup Tiller tunnel")
tillerAddr = fmt.Sprintf("127.0.0.1:%d", tillerTunnel.Local)
log.Infof("created local tunnel using local port: '%d'", tillerTunnel.Local)
}

tillerAddr := fmt.Sprintf("127.0.0.1:%d", tillerTunnel.Local)
log.Infof("created local tunnel using local port: '%d'", tillerTunnel.Local)
helmImplementer := helm.NewHelmImplementer(tillerAddr)
helmProvider := helm.NewProvider(helmImplementer, opts.sender, opts.approvalsManager)

Expand Down

0 comments on commit 743309d

Please sign in to comment.