Skip to content
Snippets Groups Projects
Verified Commit f9fe1a98 authored by Varac's avatar Varac
Browse files

Untemplate rke config

Closes: #321
parent 3a421a42
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,15 @@ helmfiles:
- 10-nginx
- 15-monitoring
- 20-nextcloud
# Optional, custom rke config. I.e., allow disabling ipv6 in pods by
# Optional, custom rke config.
# I.e. you can set the desired Kubernetes version but please be aware of
# the [every rke release has only a few supported kubernetes versions](https://rancher.com/docs/rke/latest/en/config-options/#kubernetes-version).
#
# rke_custom_config:
# kubernetes_version: "v1.14.3-rancher1-1"
#
# Another example is allowing to disable ipv6 in pods by
# passing adding an additional argument to the kubelet:
# `--allowed-unsafe-sysctls net.ipv6.conf.all.disable_ipv6`
#
......
rke_configuration_location: "{{ data_directory }}/rke/cluster.yml"
rke_ssh_key_path: "{{ data_directory }}/ssh/ssh_key"
rke_ssh_agent_auth: "false"
# Whether to support customer flexvolume driver plugins, by mounting the path
# /usr/libexec/kubernetes/kubelet-plugins/volume/exec into kubelet.
flexvolume_plugins: false
......@@ -24,37 +24,13 @@ ingress:
options: {}
# Set this to none, so we can install nginx ourselves.
provider: none
kubernetes_version: {{ kubernetes_version }}
kubernetes_version: 'v1.14.3-rancher1-1'
monitoring:
options: {}
provider: ''
network:
options: {}
plugin: canal
nodes:
{% for node in groups['all'] %}
- address: {{ hostvars[node]['ansible_host'] }}
# port: '22'
# internal_address: ''
hostname_override: {{ hostvars[node]['inventory_hostname'] }}
# labels: {}
role:
{% if hostvars[node]['inventory_hostname'] in groups.master %}
- controlplane
- etcd
{% endif %}
{% if hostvars[node]['inventory_hostname'] in groups.worker %}
- worker
{% endif %}
# docker_socket: /var/run/docker.sock
# ssh_key: ''
{% if rke_ssh_key_path is defined %}
ssh_key_path: {{ rke_ssh_key_path }}
{% else %}
# ssh_key_path: ''
{% endif %}
user: {{ hostvars[node]['ansible_user'] }}
{% endfor %}
prefix_path: ''
private_registries: []
services:
......@@ -82,16 +58,10 @@ services:
cluster_domain: cluster.local
extra_args:
containerized: 'true'
{% if flexvolume_plugins %}
volume-plugin-dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
{% endif %}
extra_binds:
# Make local storage work with persistent volumes that use `subpath`
# see https://open.greenhost.net/openappstack/openappstack/issues/236
- /:/rootfs:rshared
{% if flexvolume_plugins %}
- /usr/libexec/kubernetes/kubelet-plugins/volume/exec:/usr/libexec/kubernetes/kubelet-plugins/volume/exec
{% endif %}
fail_swap_on: false
image: ''
infra_container_image: ''
......@@ -99,4 +69,4 @@ services:
image: ''
scheduler:
image: ''
ssh_agent_auth: {{ rke_ssh_agent_auth }}
ssh_agent_auth: false
......@@ -29,13 +29,24 @@
become: true
- name: Copy rke cluster configuration file
- name: Deploy rke cluster configuration file
tags:
- tmp
- rke
vars:
additional_config:
nodes:
- address: "{{ ansible_host }}"
hostname_override: "{{ inventory_hostname }}"
role:
- controlplane
- etcd
- worker
ssh_key_path: '/var/lib/OpenAppStack/ssh/ssh_key'
user: "{{ ansible_user }}"
# Allow undefined rke_custom_config variable
custom_config: "{{ rke_custom_config | default({}) }}"
copy:
content: "{{ lookup('template', 'cluster.yml.j2') | from_yaml | combine(custom_config, recursive=True) | to_nice_yaml(indent=2) }}"
dest: "{{ rke_configuration_location }}"
content: "{{ lookup('file', 'cluster-defaults.yml') | from_yaml | combine(additional_config, custom_config, recursive=True) | to_nice_yaml(indent=2) }}"
dest: "{{ data_directory }}/rke/cluster.yml"
become: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment