image-builder update for cloud-init integration
* Make kernel config available to kubernetes validation * Install k8s via apt instead of curl * Update sysctl defaults Change-Id: I3f04973393e0a131afb30dc30869c859372ff812
This commit is contained in:
parent
bc9931f1a2
commit
f3ff01ae94
@ -1,25 +1,30 @@
|
|||||||
- name: ansible copy file locally.
|
- name: ansible copy file locally - vmlinuz.
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ root_image }}/vmlinuz"
|
dest: "{{ root_image }}/vmlinuz"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
with_fileglob: "{{ root_chroot }}/boot/vmlinuz-*"
|
with_fileglob: "{{ root_chroot }}/boot/vmlinuz-*"
|
||||||
|
|
||||||
- name: ansible copy file locally.
|
- name: ansible copy file locally - initrd.
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ root_image }}/initrd"
|
dest: "{{ root_image }}/initrd"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
with_fileglob: "{{ root_chroot }}/boot/initrd.img-*"
|
with_fileglob: "{{ root_chroot }}/boot/initrd.img-*"
|
||||||
|
|
||||||
|
- name: ansible copy file locally - config.
|
||||||
|
copy:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "{{ root_image }}/config"
|
||||||
|
remote_src: yes
|
||||||
|
with_fileglob: "{{ root_chroot }}/boot/config-*"
|
||||||
|
|
||||||
- name: "Stamp out a marker file for grub to use when identifying the desired boot volume"
|
- name: "Stamp out a marker file for grub to use when identifying the desired boot volume"
|
||||||
copy:
|
copy:
|
||||||
#TODO: populate this with meaningful content
|
#TODO: populate this with meaningful content
|
||||||
content: "{{ ansible_date_time.date }}"
|
content: "{{ ansible_date_time.date }}"
|
||||||
dest: "{{ root_image }}/AIRSHIP_EPHEMERAL"
|
dest: "{{ root_image }}/AIRSHIP_EPHEMERAL"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: "create directory for boot image assembly"
|
- name: "create directory for boot image assembly"
|
||||||
tempfile:
|
tempfile:
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -22,7 +22,7 @@ repos:
|
|||||||
- ethtool
|
- ethtool
|
||||||
- file
|
- file
|
||||||
- gettext-base
|
- gettext-base
|
||||||
#- kdump-tools # cannot install until after kernel is available
|
- gnupg2
|
||||||
#- grub2 # cannot install until after boot partition is available
|
#- grub2 # cannot install until after boot partition is available
|
||||||
- ifenslave
|
- ifenslave
|
||||||
- isc-dhcp-client
|
- isc-dhcp-client
|
||||||
@ -92,3 +92,14 @@ repos:
|
|||||||
suite: focal
|
suite: focal
|
||||||
omitdebsrc: "true"
|
omitdebsrc: "true"
|
||||||
components: stable
|
components: stable
|
||||||
|
- register_repo_with_rootfs: true
|
||||||
|
name: Kubernetes
|
||||||
|
packages:
|
||||||
|
- kubelet=1.18.6-00
|
||||||
|
- kubeadm=1.18.6-00
|
||||||
|
- kubectl=1.18.6-00
|
||||||
|
source: https://apt.kubernetes.io
|
||||||
|
keyring_url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
||||||
|
suite: kubernetes-xenial
|
||||||
|
omitdebsrc: "true"
|
||||||
|
components: main
|
||||||
|
@ -49,7 +49,9 @@ limits:
|
|||||||
value: 0
|
value: 0
|
||||||
|
|
||||||
sysctl:
|
sysctl:
|
||||||
- name: net.ipv4.ip_forward
|
- name: net.bridge.bridge-nf-call-ip6tables
|
||||||
|
value: '1'
|
||||||
|
- name: net.bridge.bridge-nf-call-iptables
|
||||||
value: '1'
|
value: '1'
|
||||||
|
|
||||||
# Any directories to create on disk can be defined here
|
# Any directories to create on disk can be defined here
|
||||||
|
@ -1,24 +1,9 @@
|
|||||||
- name: "Kubernetes | Download and install binaries for {{ k8s_version }}"
|
|
||||||
delegate_to: localhost
|
|
||||||
get_url:
|
|
||||||
url: "https://storage.googleapis.com/kubernetes-release/release/{{ k8s_version }}/bin/linux/amd64/{{ item }}"
|
|
||||||
dest: "{{ rootfs_root }}/usr/bin/{{ item }}"
|
|
||||||
mode: '0755'
|
|
||||||
with_items:
|
|
||||||
- kubeadm
|
|
||||||
- kubelet
|
|
||||||
- kubectl
|
|
||||||
- name: "Kubernetes | write out kubelet unit file"
|
|
||||||
template:
|
|
||||||
src: kubelet.service.j2
|
|
||||||
dest: "/etc/systemd/system/kubelet.service"
|
|
||||||
mode: 0644
|
|
||||||
|
|
||||||
- name: "Kubernetes | Ensuring systemd preset directory exists"
|
- name: "Kubernetes | Ensuring systemd preset directory exists"
|
||||||
file:
|
file:
|
||||||
path: "/etc/systemd/system-preset"
|
path: "/etc/systemd/system-preset"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
# Started instead by cloud-init run commands
|
||||||
- name: "Kubernetes | Dont enable kubelet unit by default"
|
- name: "Kubernetes | Dont enable kubelet unit by default"
|
||||||
copy:
|
copy:
|
||||||
content: 'disable kubelet.service'
|
content: 'disable kubelet.service'
|
||||||
|
@ -130,6 +130,10 @@ sysctl:
|
|||||||
value: '1'
|
value: '1'
|
||||||
- name: kernel.sysrq
|
- name: kernel.sysrq
|
||||||
value: '1'
|
value: '1'
|
||||||
|
- name: net.bridge.bridge-nf-call-ip6tables
|
||||||
|
value: '1'
|
||||||
|
- name: net.bridge.bridge-nf-call-iptables
|
||||||
|
value: '1'
|
||||||
|
|
||||||
post_install_package_list:
|
post_install_package_list:
|
||||||
- kdump-tools
|
- kdump-tools
|
||||||
|
@ -24,3 +24,5 @@ runcmd:
|
|||||||
- set -x
|
- set -x
|
||||||
- export PATH=$PATH:/usr/sbin:/sbin
|
- export PATH=$PATH:/usr/sbin:/sbin
|
||||||
- mkdir -p /opt/metal3-dev-env/ironic/html/images /var/lib/ironic-persisted-data-volume
|
- mkdir -p /opt/metal3-dev-env/ironic/html/images /var/lib/ironic-persisted-data-volume
|
||||||
|
- /bin/bash -c 'kernel_libsubdir="$(ls /lib/modules | head -1)"; config_dir="/lib/modules/${kernel_libsubdir}/build"; mkdir -p "${config_dir}"; if [ -f /run/live/medium/config ] && [ ! -f "${config_dir}/.config" ]; then ln -s /run/live/medium/config "${config_dir}/.config"; fi;'
|
||||||
|
- kubeadm init
|
||||||
|
Loading…
x
Reference in New Issue
Block a user