Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion nuvolaris/etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import logging
import kopf

from nuvolaris.util import get_etcd_replica


def create(owner=None):
logging.info("create etcd")
data = util.get_etcd_config_data()
Expand All @@ -34,9 +37,14 @@ def create(owner=None):
if(data['affinity'] or data['tolerations']):
tplp.append("affinity-tolerance-sts-core-attach.yaml")

spec_templates = []
replicas = get_etcd_replica()
if replicas > 1:
spec_templates.append("etcd-policy.yaml")

kust = kus.patchTemplates("etcd",tplp , data)
kust += kus.patchGenericEntry("Secret","nuvolaris-etcd-secret","/data/rootPassword",util.b64_encode(data['root_password']))
spec = kus.kustom_list("etcd", kust, templates=[], data=data)
spec = kus.kustom_list("etcd", kust, templates=spec_templates, data=data)

if owner:
kopf.append_owner_reference(spec['items'], owner)
Expand Down
2 changes: 1 addition & 1 deletion nuvolaris/kustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def restricted_kustomize(where, *what, templates=[], templates_filter=[],data={}
continue
if file in templates_filter:
f.write(f"- {file}\n")
# adding extra temmplatized resources
# adding extra templatized resources
for template in templates:
out = f"deploy/{where}/__{template}"
file = ntp.spool_template(template, out, data)
Expand Down
File renamed without changes.
Loading