-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from TimGrt/dev
Dev
- Loading branch information
Showing
20 changed files
with
118 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
[target] | ||
awx ansible_host=192.168.178.122 ansible_user=ansible | ||
[kubernetes_cluster:children] | ||
kubernetes_control_plane | ||
kubernetes_nodes | ||
|
||
[kubernetes_cluster:vars] | ||
ansible_user=ansible | ||
|
||
[kubernetes_control_plane] | ||
rpi-cluster01 ansible_host=192.168.178.151 | ||
|
||
[kubernetes_nodes] | ||
rpi-cluster02 ansible_host=192.168.178.152 | ||
rpi-cluster03 ansible_host=192.168.178.153 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
- name: Deploy AWX operator and instance on Kubernetes | ||
hosts: kubernetes_control_plane | ||
roles: | ||
- awx |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
- name: Deploy k3s-server | ||
hosts: kubernetes_cluster | ||
roles: | ||
- k3s-deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
# Defining group aliases, overwrite these if your inventory groups differ | ||
# This prevents the need to overwrite the groups in the role itself | ||
k3s_server_group: kubernetes_control_plane | ||
k3s_agent_group: kubernetes_nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
|
||
- name: Get K3s server token from control plane node | ||
ansible.builtin.slurp: | ||
path: /var/lib/rancher/k3s/server/node-token | ||
register: k3s_server_token_file | ||
become: true | ||
when: inventory_hostname in groups[k3s_server_group] | ||
run_once: true | ||
|
||
- name: Execute install script to deploy K3s agent | ||
ansible.builtin.command: | ||
cmd: sh k3s-install.sh | ||
chdir: "{{ ansible_user_dir }}" | ||
creates: /usr/local/bin/k3s | ||
become: true | ||
environment: | ||
K3S_URL: https://{{ hostvars[groups[k3s_server_group][0]]['ansible_host'] }}:6443 | ||
K3S_TOKEN: "{{ k3s_server_token_file.content | b64decode | trim }}" | ||
|
||
- name: Get info about K3s cluster nodes and wait until all report Ready status | ||
kubernetes.core.k8s_info: | ||
api_version: v1 | ||
kind: Node | ||
name: "{{ item }}" | ||
wait: true | ||
wait_timeout: 5 | ||
wait_condition: | ||
type: Ready | ||
loop: "{{ groups['kubernetes_cluster'] }}" | ||
loop_control: | ||
label: Checking 'Ready' condition of {{ item }} | ||
when: inventory_hostname in groups[k3s_server_group] | ||
run_once: true | ||
register: kubernetes_node_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
--- | ||
|
||
- name: Install Python3 package manager | ||
- name: Install Python3 kubernetes package for module functionality | ||
ansible.builtin.package: | ||
name: python3-pip | ||
name: python3-kubernetes | ||
state: present | ||
become: true | ||
|
||
- name: Install kubernetes Python package for module functionality | ||
ansible.builtin.pip: | ||
name: kubernetes | ||
state: present | ||
- name: Ensure Memory CGroup is available | ||
ansible.builtin.stat: | ||
path: /sys/fs/cgroup/memory.stat | ||
register: memory_cgroup_file | ||
failed_when: not memory_cgroup_file.stat.exists | ||
|
||
- name: Stop and disable firewalld | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: stopped | ||
enabled: false | ||
become: true | ||
when: ansible_facts['distribution'] == "Red Hat" | ||
|
||
- name: Get K3S installation script | ||
ansible.builtin.get_url: | ||
url: https://get.k3s.io | ||
dest: "{{ ansible_user_dir }}/k3s-install.sh" | ||
mode: "0644" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
exposed_node_port: 30080 | ||
awx_instance_port: 30080 | ||
|
||
minikube_download_directory: "{{ ansible_user_dir }}" | ||
|
||
minikube_additional_start_parameter: "--cpus=4 --memory=6g --addons=ingress --container-runtime=containerd --ports={{ exposed_node_port }}:{{ exposed_node_port }}" | ||
minikube_additional_start_parameter: "--cpus=4 --memory=6g --addons=ingress --container-runtime=containerd --ports={{ awx_instance_port }}:{{ awx_instance_port }}" |