Browse Source

Improve variable handling for disabling etcd events cluster

pull/2899/head
Matthew Mosesohn 6 years ago
parent
commit
61e97251a5
5 changed files with 7 additions and 4 deletions
  1. 2
      cluster.yml
  2. 3
      roles/etcd/defaults/main.yml
  3. 2
      roles/kubernetes/master/templates/kubeadm-config.yaml.j2
  4. 2
      roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2
  5. 2
      roles/kubespray-defaults/defaults/main.yaml

2
cluster.yml

@ -51,7 +51,7 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
roles:
- { role: kubespray-defaults}
- { role: etcd, tags: etcd, etcd_cluster_setup: true, etcd_events_cluster_setup: true }
- { role: etcd, tags: etcd, etcd_cluster_setup: true, etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}" }
- hosts: k8s-cluster:calico-rr
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"

3
roles/etcd/defaults/main.yml

@ -3,6 +3,9 @@
etcd_cluster_setup: true
etcd_events_cluster_setup: false
# Set to true to separate k8s events to a different etcd cluster
etcd_events_cluster_enabled: false
etcd_backup_prefix: "/var/backups"
etcd_data_dir: "/var/lib/etcd"
etcd_events_data_dir: "/var/lib/etcd-events"

2
roles/kubernetes/master/templates/kubeadm-config.yaml.j2

@ -39,7 +39,7 @@ apiServerExtraArgs:
{% if kube_version | version_compare('v1.9', '>=') %}
endpoint-reconciler-type: lease
{% endif %}
{% if etcd_events_cluster_setup %}
{% if etcd_events_cluster_enabled %}
etcd-servers-overrides: "/events#{{ etcd_events_access_addresses }}"
{% endif %}
service-node-port-range: {{ kube_apiserver_node_port_range }}

2
roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2

@ -30,7 +30,7 @@ spec:
- apiserver
- --advertise-address={{ ip | default(ansible_default_ipv4.address) }}
- --etcd-servers={{ etcd_access_addresses }}
{% if etcd_events_cluster_setup %}
{% if etcd_events_cluster_enabled %}
- --etcd-servers-overrides=/events#{{ etcd_events_access_addresses }}
{% endif %}
{% if kube_version | version_compare('v1.9', '<') %}

2
roles/kubespray-defaults/defaults/main.yaml

@ -314,7 +314,7 @@ kube_apiserver_client_key: |-
{%- endif %}
# Set to true to deploy etcd-events cluster
etcd_events_cluster_setup: false
etcd_events_cluster_enabled: false
# Vars for pointing to etcd endpoints
is_etcd_master: "{{ inventory_hostname in groups['etcd'] }}"

Loading…
Cancel
Save