Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 16, 2023
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
8 changes: 8 additions & 0 deletions inventory/sample/group_vars/all/hcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}