Przeglądaj źródła

Remove unneeded embedded etcd logic

Removing some remaining embedded etcd facts except
for the migration plays.
Michael Gugino 7 lat temu
rodzic
commit
ed4d3fb421

+ 0 - 14
playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml

@@ -2,20 +2,6 @@
 ###############################################################################
 # Upgrade Masters
 ###############################################################################
-
-# If facts cache were for some reason deleted, this fact may not be set, and if not set
-# it will always default to true. This causes problems for the etcd data dir fact detection
-# so we must first make sure this is set correctly before attempting the backup.
-- name: Set master embedded_etcd fact
-  hosts: oo_masters_to_config
-  roles:
-  - openshift_facts
-  tasks:
-  - openshift_facts:
-      role: master
-      local_facts:
-        embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
-
 - name: Backup and upgrade etcd
   import_playbook: ../../../openshift-etcd/private/upgrade_main.yml
 

+ 1 - 6
playbooks/init/evaluate_groups.yml

@@ -46,14 +46,9 @@
   - name: Evaluate groups - Fail if no etcd hosts group is defined
     fail:
       msg: >
-        Running etcd as an embedded service is no longer supported. If this is a
-        new install please define an 'etcd' group with either one or three
-        hosts. These hosts may be the same hosts as your masters. If this is an
-        upgrade you may set openshift_master_unsupported_embedded_etcd=true
-        until a migration playbook becomes available.
+        Running etcd as an embedded service is no longer supported.
     when:
     - g_etcd_hosts | default([]) | length not in [3,1]
-    - not openshift_master_unsupported_embedded_etcd | default(False)
     - not (openshift_node_bootstrap | default(False))
 
   - name: Evaluate oo_all_hosts

+ 0 - 4
playbooks/openshift-etcd/private/migrate.yml

@@ -19,7 +19,6 @@
       name: etcd
       tasks_from: migrate.pre_check.yml
     vars:
-      r_etcd_common_embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
       etcd_peer: "{{ ansible_default_ipv4.address }}"
 
 # TODO: This will be different for release-3.6 branch
@@ -49,7 +48,6 @@
       tasks_from: backup.yml
     vars:
       r_etcd_common_backup_tag: pre-migration
-      r_etcd_common_embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
       r_etcd_common_backup_sufix_name: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
 
 - name: Gate on etcd backup
@@ -84,7 +82,6 @@
       name: etcd
       tasks_from: migrate.yml
     vars:
-      r_etcd_common_embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
       etcd_peer: "{{ openshift.common.ip }}"
       etcd_url_scheme: "https"
       etcd_peer_url_scheme: "https"
@@ -97,7 +94,6 @@
       name: etcd
       tasks_from: clean_data.yml
     vars:
-      r_etcd_common_embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
       etcd_peer: "{{ openshift.common.ip }}"
       etcd_url_scheme: "https"
       etcd_peer_url_scheme: "https"

+ 0 - 1
playbooks/openshift-etcd/private/upgrade_backup.yml

@@ -9,7 +9,6 @@
       tasks_from: backup.yml
     vars:
       r_etcd_common_backup_tag: "{{ etcd_backup_tag }}"
-      r_etcd_common_embedded_etcd: "{{ groups.oo_etcd_to_config | default([]) | length == 0 }}"
       r_etcd_common_backup_sufix_name: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"
 
 - name: Gate on etcd backup

+ 0 - 1
playbooks/openshift-node/private/additional_config.yml

@@ -33,7 +33,6 @@
   roles:
   - role: flannel
     etcd_urls: "{{ hostvars[groups.oo_first_master.0].openshift.master.etcd_urls }}"
-    embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
     when: openshift_use_flannel | default(false) | bool
 
 - name: Additional node config

+ 0 - 1
roles/calico/tasks/main.yml

@@ -14,7 +14,6 @@
   vars:
     etcd_cert_prefix: calico.etcd-
     etcd_cert_config_dir: "{{ openshift.common.config_base }}/calico"
-    embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
     etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
     etcd_cert_subdir: "openshift-calico-{{ openshift.common.hostname }}"
 

+ 3 - 3
roles/flannel/defaults/main.yaml

@@ -2,8 +2,8 @@
 flannel_interface: "{{ ansible_default_ipv4.interface }}"
 flannel_etcd_key: /openshift.com/network
 etcd_hosts: "{{ etcd_urls }}"
-etcd_peer_ca_file: "{{ openshift.common.config_base }}/node/{{ 'ca' if (embedded_etcd | bool) else 'flannel.etcd-ca' }}.crt"
-etcd_peer_cert_file: "{{ openshift.common.config_base }}/node/{{ 'system:node:' + openshift.common.hostname if (embedded_etcd | bool) else 'flannel.etcd-client' }}.crt"
-etcd_peer_key_file: "{{ openshift.common.config_base }}/node/{{ 'system:node:' + openshift.common.hostname if (embedded_etcd | bool) else 'flannel.etcd-client' }}.key"
+etcd_peer_ca_file: "{{ openshift.common.config_base }}/node/flannel.etcd-ca.crt"
+etcd_peer_cert_file: "{{ openshift.common.config_base }}/node/flannel.etcd-client.crt"
+etcd_peer_key_file: "{{ openshift.common.config_base }}/node/flannel.etcd-client.key"
 
 openshift_docker_service_name: "{{ 'container-engine' if (openshift_docker_use_system_container | default(False)) else 'docker' }}"

+ 1 - 1
roles/flannel_register/defaults/main.yaml

@@ -4,6 +4,6 @@ flannel_subnet_len: "{{ 32 - (openshift.master.sdn_host_subnet_length | int) }}"
 flannel_etcd_key: /openshift.com/network
 etcd_hosts: "{{ etcd_urls }}"
 etcd_conf_dir: "{{ openshift.common.config_base }}/master"
-etcd_peer_ca_file: "{{ etcd_conf_dir + '/ca.crt' if (openshift.master.embedded_etcd | bool) else etcd_conf_dir + '/master.etcd-ca.crt' }}"
+etcd_peer_ca_file: "{{ etcd_conf_dir + '/master.etcd-ca.crt' }}"
 etcd_peer_cert_file: "{{ etcd_conf_dir }}/master.etcd-client.crt"
 etcd_peer_key_file: "{{ etcd_conf_dir }}/master.etcd-client.key"

+ 1 - 2
roles/openshift_facts/library/openshift_facts.py

@@ -458,7 +458,6 @@ def set_url_facts_if_unset(facts):
         etcd_urls = []
         if etcd_hosts != '':
             facts['master']['etcd_port'] = ports['etcd']
-            facts['master']['embedded_etcd'] = False
             for host in etcd_hosts:
                 etcd_urls.append(format_url(use_ssl['etcd'], host,
                                             ports['etcd']))
@@ -1595,7 +1594,7 @@ class OpenShiftFacts(object):
                                       console_port='8443', etcd_use_ssl=True,
                                       etcd_hosts='', etcd_port='4001',
                                       portal_net='172.30.0.0/16',
-                                      embedded_etcd=True, embedded_kube=True,
+                                      embedded_kube=True,
                                       embedded_dns=True,
                                       bind_addr='0.0.0.0',
                                       session_max_seconds=3600,

+ 1 - 17
roles/openshift_master/templates/master.yaml.v1.j2

@@ -69,29 +69,13 @@ dnsConfig:
   bindNetwork: tcp4
 {% endif %}
 etcdClientInfo:
-  ca: {{ "ca-bundle.crt" if (openshift.master.embedded_etcd | bool) else "master.etcd-ca.crt" }}
+  ca: master.etcd-ca.crt
   certFile: master.etcd-client.crt
   keyFile: master.etcd-client.key
   urls:
 {% for etcd_url in openshift.master.etcd_urls %}
     - {{ etcd_url }}
 {% endfor %}
-{% if openshift.master.embedded_etcd | bool %}
-etcdConfig:
-  address: {{ openshift.common.hostname }}:{{ openshift.master.etcd_port }}
-  peerAddress: {{ openshift.common.hostname }}:7001
-  peerServingInfo:
-    bindAddress: {{ openshift.master.bind_addr }}:7001
-    certFile: etcd.server.crt
-    clientCA: ca-bundle.crt
-    keyFile: etcd.server.key
-  servingInfo:
-    bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.etcd_port }}
-    certFile: etcd.server.crt
-    clientCA: ca-bundle.crt
-    keyFile: etcd.server.key
-  storageDirectory: {{ r_openshift_master_data_dir }}/openshift.local.etcd
-{% endif %}
 etcdStorageConfig:
   kubernetesStoragePrefix: kubernetes.io
   kubernetesStorageVersion: v1

+ 0 - 1
roles/openshift_master_facts/tasks/main.yml

@@ -45,7 +45,6 @@
       etcd_port: "{{ openshift_master_etcd_port | default(None) }}"
       etcd_use_ssl: "{{ openshift_master_etcd_use_ssl | default(None) }}"
       etcd_urls: "{{ openshift_master_etcd_urls | default(None) }}"
-      embedded_etcd: "{{ openshift_master_embedded_etcd | default(None) }}"
       embedded_kube: "{{ openshift_master_embedded_kube | default(None) }}"
       embedded_dns: "{{ openshift_master_embedded_dns | default(None) }}"
       bind_addr: "{{ openshift_master_bind_addr | default(None) }}"