Skip to content

Commit d596f5d

Browse files
author
Dmitriy Rabotyagov
committed
Ensure that k8s hostname is lowercased
In case your hostname contains upper-level symbols, they will be all lowered in k8s cluster. With that it's important to ensure that the expected hostname used in roles is always lowercase one. Change-Id: I31e483cc7766e26f932984067daee6983122db10
1 parent 66c4f75 commit d596f5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mcapi_vexxhost/playbooks/files/openstack_deploy/user_variables_k8s.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wire OSA group, host and network addresses into k8s deployment
22
kubernetes_control_plane_group: k8s_container
3-
kubelet_hostname: "{{ ansible_facts['hostname'] }}"
3+
kubelet_hostname: "{{ ansible_facts['hostname'] | lower }}"
44
kubelet_node_ip: "{{ management_address }}"
55
kubernetes_hostname: "{{ internal_lb_vip_address }}"
66
kubernetes_non_init_namespace: true

mcapi_vexxhost/playbooks/mcapi_control_plane_k8s.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,13 @@
124124
- role: "vexxhost.kubernetes.cilium"
125125
environment: "{{ deployment_environment_variables | default({}) }}"
126126
tasks:
127-
- kubernetes.core.k8s:
127+
- name: Ensure Nodes are defined and labeled
128+
kubernetes.core.k8s:
128129
definition:
129130
apiVersion: v1
130131
kind: Node
131132
metadata:
132-
name: "{{ inventory_hostname }}"
133+
name: "{{ inventory_hostname | lower }}"
133134
labels: "{{ k8s_node_labels }}"
134135
tags:
135136
- k8s

0 commit comments

Comments
 (0)