mirror of https://github.com/kubernetes/kops.git
Refactor Gossip usage in addon templates
This commit is contained in:
parent
362601cd66
commit
b08d53a131
|
|
@ -76,8 +76,8 @@ data:
|
|||
fallthrough in-addr.arpa ip6.arpa
|
||||
ttl 30
|
||||
}
|
||||
{{- if GossipDomains }}
|
||||
hosts /rootfs/etc/hosts {{ join " " GossipDomains }} {
|
||||
{{- if GossipName }}
|
||||
hosts /rootfs/etc/hosts k8s.local {
|
||||
ttl 30
|
||||
fallthrough
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ spec:
|
|||
- name: config-volume
|
||||
mountPath: /etc/coredns
|
||||
readOnly: true
|
||||
{{- if GossipDomains }}
|
||||
{{- if GossipName }}
|
||||
- name: etc-hosts
|
||||
mountPath: /rootfs/etc/hosts
|
||||
readOnly: true
|
||||
|
|
@ -209,7 +209,7 @@ spec:
|
|||
- name: config-volume
|
||||
configMap:
|
||||
name: coredns
|
||||
{{- if GossipDomains }}
|
||||
{{- if GossipName }}
|
||||
- name: etc-hosts
|
||||
hostPath:
|
||||
path: /etc/hosts
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ rules:
|
|||
- list
|
||||
- watch
|
||||
- patch
|
||||
{{- if GossipDomains }}
|
||||
{{- if GossipEnabled }}
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
|
|
@ -213,7 +213,7 @@ rules:
|
|||
- leases
|
||||
verbs:
|
||||
- create
|
||||
{{- if GossipDomains }}
|
||||
{{- if GossipEnabled }}
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
|
|
|
|||
|
|
@ -124,14 +124,17 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
|
|||
return cluster.Spec.KubeDNS
|
||||
}
|
||||
|
||||
dest["GossipDomains"] = func() []string {
|
||||
var names []string
|
||||
|
||||
if dns.IsGossipClusterName(cluster.Name) {
|
||||
names = append(names, "k8s.local")
|
||||
dest["GossipEnabled"] = func() bool {
|
||||
if cluster.IsGossip() {
|
||||
return true
|
||||
}
|
||||
|
||||
return names
|
||||
return false
|
||||
}
|
||||
dest["GossipName"] = func() bool {
|
||||
if dns.IsGossipClusterName(cluster.Name) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
dest["NodeLocalDNSClusterIP"] = func() string {
|
||||
|
|
|
|||
Loading…
Reference in New Issue