This is an example of the syntax of GO template, what is done here:
- Make
$domainvariable with an empty value. - Make
$nsvariables with values derivedNAMESPACEEnvironmental variable. So, we need to fill it first to make logic function. For exampleexport NAMESPACE=staging. - Logic / IF-ELSE Conditional to check equality (
eq) from$ns. printfFunction for a combination of string.
{{ $domain := "" }}
{{ $ns := env "NAMESPACE" -}}
{{ if eq $ns "staging" -}}
{{ $domain = printf ".%s.svc.cluster.local:2200" $ns }}
{{ else -}}
{{ $domain = printf ".%s.svc.cluster.local:2200" $ns }}
{{ end }}
Admin Lukmanlab, Devops engineer, site reliability engineer, system administrator.
Game Center
Game News
Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime