1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Add cluster-domain option for bootstrap command

Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
This commit is contained in:
Léopold Jacquot
2020-12-12 16:11:55 +01:00
parent b6c63a1aa4
commit 4d7df52dbe
8 changed files with 31 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ type Options struct {
ManifestFile string
Timeout time.Duration
TargetPath string
ClusterDomain string
}
func MakeDefaultOptions() Options {
@@ -53,6 +54,7 @@ func MakeDefaultOptions() Options {
ManifestFile: "gotk-components.yaml",
Timeout: time.Minute,
TargetPath: "",
ClusterDomain: "cluster.local",
}
}

View File

@@ -30,6 +30,7 @@ var kustomizationTmpl = `---
{{- $registry := .Registry }}
{{- $arch := .Arch }}
{{- $logLevel := .LogLevel }}
{{- $clusterDomain := .ClusterDomain }}
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: {{.Namespace}}
@@ -67,6 +68,25 @@ patchesJson6902:
- op: replace
path: /spec/template/spec/containers/0/args/1
value: --log-level={{$logLevel}}
{{- else if eq $component "source-controller" }}
- target:
group: apps
version: v1
kind: Deployment
name: {{$component}}
patch: |-
- op: replace
path: /spec/template/spec/containers/0/args/0
value: --events-addr={{$eventsAddr}}
- op: replace
path: /spec/template/spec/containers/0/args/1
value: --watch-all-namespaces={{$watchAllNamespaces}}
- op: replace
path: /spec/template/spec/containers/0/args/2
value: --log-level={{$logLevel}}
- op: replace
path: /spec/template/spec/containers/0/args/6
value: --storage-adv-addr=source-controller.$(RUNTIME_NAMESPACE).svc.{{$clusterDomain}}.
{{- else }}
- target:
group: apps