This is an example of the syntax of GO template, what is done here:
- Make
$domain
variable with an empty value. - Make
$ns
variables with values derivedNAMESPACE
Environmental 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
. printf
Function 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