Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
assets: Change hostname for AWS nodes in ignition config
Browse files Browse the repository at this point in the history
Changes the hostname for AWS clusters to the naming scheme
preferred by Cloud Controller Manager in order to allow us
to set up LoadBalancer services on AWS.

Required for #145
  • Loading branch information
BrainBlasted committed Jul 7, 2020
1 parent e41922b commit 7b43184
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
systemd:
units:
- name: set-hostname.service
enable: true
contents: |
[Unit]
Description=Set the hostname programmitcally for the AWS-preferred format
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'hostnamectl set-hostname $(curl -s http://169.254.169.254/latest/meta-data/hostname)'
[Install]
RequiredBy=kubelet.service
- name: etcd-member.service
enable: true
dropins:
Expand Down Expand Up @@ -52,6 +64,7 @@ systemd:
[Unit]
Description=Kubelet via Hyperkube
Wants=rpc-statd.service
Wants=set-hostname.service
[Service]
ConditionPathExists=/etc/kubernetes/kubeconfig
EnvironmentFile=/etc/kubernetes/kubelet.env
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
systemd:
units:
- name: set-hostname.service
enable: true
contents: |
[Unit]
Description=Set the hostname programmitcally for the AWS-preferred format
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/sh -c 'hostnamectl set-hostname $(curl -s http://169.254.169.254/latest/meta-data/hostname)'
[Install]
RequiredBy=kubelet.service
- name: docker.service
enable: true
- name: iscsid.service
Expand All @@ -27,6 +39,7 @@ systemd:
[Unit]
Description=Kubelet via Hyperkube
Wants=rpc-statd.service
Wants=set-hostname.service
[Service]
EnvironmentFile=/etc/kubernetes/kubelet.env
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \
Expand Down
Loading

0 comments on commit 7b43184

Please sign in to comment.