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

pull/10364/head
cortex3 2023-08-16 14:14:27 +02:00 committed by GitHub
parent cd69283184
commit 4c37399c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 1 deletions

View File

@ -3,6 +3,7 @@
# hcloud_api_token: ""
# token_secret_name: hcloud
# with_networks: false # Use the hcloud controller-manager with networks support https://github.com/hetznercloud/hcloud-cloud-controller-manager#networks-support
# network_name: # network name/ID: If you manage the network yourself it might still be required to let the CCM know about private networks
# service_account_name: cloud-controller-manager
#
# controller_image_tag: "latest"
@ -12,3 +13,10 @@
# ## arg1: "value1"
# ## arg2: "value2"
# controller_extra_args: {}
#
# load_balancers_location: # mutually exclusive with load_balancers_network_zone
# load_balancers_network_zone:
# load_balancers_disable_private_ingress: # set to true if using IPVS based plugins https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/main/docs/load_balancers.md#sample-service-with-networks
# load_balancers_use_private_ip: # set to true if using private networks
# load_balancers_enabled:
# network_routes_enabled:

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 %}