fix hcloud-cloud-controller-manager not working in certain setups (#10297)

This commit is contained in:
cortex3
2023-08-16 14:14:27 +02:00
committed by GitHub
parent cd69283184
commit 4c37399c75
4 changed files with 68 additions and 1 deletions

View File

@@ -70,3 +70,27 @@ spec:
secretKeyRef:
name: {{ external_hcloud_cloud.token_secret_name }}
key: network
{% if external_hcloud_cloud.network_routes_enabled is defined %}
- name: HCLOUD_NETWORK_ROUTES_ENABLED
value: "{{ external_hcloud_cloud.network_routes_enabled }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_location is defined %}
- name: HCLOUD_LOAD_BALANCERS_LOCATION
value: "{{ external_hcloud_cloud.load_balancers_location }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_network_zone is defined %}
- name: HCLOUD_LOAD_BALANCERS_NETWORK_ZONE
value: "{{ external_hcloud_cloud.load_balancers_network_zone }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_disable_private_ingress is defined %}
- name: HCLOUD_LOAD_BALANCERS_DISABLE_PRIVATE_INGRESS
value: "{{ external_hcloud_cloud.load_balancers_disable_private_ingress }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_use_private_ip is defined %}
- name: HCLOUD_LOAD_BALANCERS_USE_PRIVATE_IP
value: "{{ external_hcloud_cloud.load_balancers_use_private_ip }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_enabled is defined %}
- name: HCLOUD_LOAD_BALANCERS_ENABLED
value: "{{ external_hcloud_cloud.load_balancers_enabled }}"
{% endif %}

View File

@@ -61,3 +61,34 @@ spec:
secretKeyRef:
name: {{ external_hcloud_cloud.token_secret_name }}
key: token
{% if external_hcloud_cloud.network_name is defined %}
- name: HCLOUD_NETWORK
valueFrom:
secretKeyRef:
name: {{ external_hcloud_cloud.token_secret_name }}
key: network
{% endif %}
{% if external_hcloud_cloud.network_routes_enabled is defined %}
- name: HCLOUD_NETWORK_ROUTES_ENABLED
value: "{{ external_hcloud_cloud.network_routes_enabled }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_location is defined %}
- name: HCLOUD_LOAD_BALANCERS_LOCATION
value: "{{ external_hcloud_cloud.load_balancers_location }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_network_zone is defined %}
- name: HCLOUD_LOAD_BALANCERS_NETWORK_ZONE
value: "{{ external_hcloud_cloud.load_balancers_network_zone }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_disable_private_ingress is defined %}
- name: HCLOUD_LOAD_BALANCERS_DISABLE_PRIVATE_INGRESS
value: "{{ external_hcloud_cloud.load_balancers_disable_private_ingress }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_use_private_ip is defined %}
- name: HCLOUD_LOAD_BALANCERS_USE_PRIVATE_IP
value: "{{ external_hcloud_cloud.load_balancers_use_private_ip }}"
{% endif %}
{% if external_hcloud_cloud.load_balancers_enabled is defined %}
- name: HCLOUD_LOAD_BALANCERS_ENABLED
value: "{{ external_hcloud_cloud.load_balancers_enabled }}"
{% endif %}

View File

@@ -6,6 +6,10 @@ metadata:
namespace: kube-system
data:
token: "{{ external_hcloud_cloud.hcloud_api_token | b64encode }}"
{% if external_hcloud_cloud.with_networks %}
{% if external_hcloud_cloud.with_networks or external_hcloud_cloud.network_name is defined %}
{% if network_id is defined%}
network: "{{ network_id | b64encode }}"
{% else %}
network: "{{ external_hcloud_cloud.network_name | b64encode }}"
{% endif %}
{% endif %}