-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests and fix bugs found by tests
- Loading branch information
Showing
22 changed files
with
372 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exclude_paths: | ||
- meta/ |
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,92 @@ | ||
name: CI | ||
'on': | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
working-directory: 'rlex.k3s' | ||
|
||
jobs: | ||
|
||
yaml-lint: | ||
name: YAML lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'rlex.k3s' | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies | ||
run: pip3 install yamllint | ||
|
||
- name: Lint code. | ||
run: | | ||
yamllint . | ||
ansible-lint: | ||
name: Ansible lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'rlex.k3s' | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies | ||
run: pip3 install ansible-lint | ||
|
||
- name: Lint code | ||
run: | | ||
ansible-lint . | ||
molecule: | ||
name: Molecule | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- distro: ubuntu2204 | ||
scenario: single-node | ||
- distro: debian11 | ||
scenario: single-node | ||
- distro: ubuntu2204 | ||
scenario: cluster | ||
- distro: debian11 | ||
scenario: cluster | ||
- distro: ubuntu2204 | ||
scenario: extended-settings | ||
|
||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'rlex.k3s' | ||
|
||
- name: Setup python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install ansible molecule molecule-plugins[docker] docker | ||
|
||
- name: Run Molecule tests. | ||
run: molecule test --scenario-name "${{ matrix.scenario }}" | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
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,9 @@ | ||
--- | ||
|
||
yaml-files: | ||
- '*.yaml' | ||
- '*.yml' | ||
- '.yamllint' | ||
|
||
rules: | ||
line-length: disable |
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,20 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
k3s_internal_ip: "{{ ansible_default_ipv4.address }}" | ||
k3s_agent_extra_args: | ||
- "--snapshotter=native" | ||
k3s_master_extra_args: | ||
- "--snapshotter=native" | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
when: ansible_os_family == 'Debian' | ||
changed_when: false | ||
|
||
roles: | ||
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" |
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,67 @@ | ||
--- | ||
role_name_check: 1 | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: master-1 | ||
groups: | ||
- k3s_master | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
networks: | ||
- name: k3s | ||
- name: master-2 | ||
groups: | ||
- k3s_master | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
networks: | ||
- name: k3s | ||
- name: master-3 | ||
groups: | ||
- k3s_master | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
networks: | ||
- name: k3s | ||
- name: node-1 | ||
groups: | ||
- k3s_agent | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
networks: | ||
- name: k3s | ||
provisioner: | ||
name: ansible | ||
options: | ||
diff: true | ||
inventory: | ||
group_vars: | ||
k3s_master: | ||
k3s_master: true | ||
k3s_agent: | ||
k3s_agent: true | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-converge.yml} |
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,49 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
k3s_agent_extra_args: | ||
- "--snapshotter=native" | ||
k3s_master_extra_args: | ||
- "--snapshotter=native" | ||
# test adding additonal manifests | ||
k3s_additional_manifests: | ||
- name: kata | ||
state: present | ||
definition: | ||
apiVersion: node.k8s.io/v1 | ||
kind: RuntimeClass | ||
metadata: | ||
name: kata | ||
handler: kata | ||
# test adding additional configfiles | ||
k3s_additional_config_files: | ||
- name: apiserver-tracing.yaml | ||
content: | | ||
apiVersion: apiserver.config.k8s.io/v1alpha1 | ||
kind: TracingConfiguration | ||
endpoint: 127.0.0.1:4317 | ||
samplingRatePerMillion: 100 | ||
k3s_master_additional_config: | ||
disable-cloud-controller: true | ||
k3s_kubelet_additional_config: | ||
- "cloud-provider=external" | ||
k3s_additional_packages: | ||
- open-iscsi | ||
k3s_gvisor: true | ||
k3s_gvisor_config: | ||
network: host | ||
k3s_server_disable: | ||
- metrics-server | ||
- traefik | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
when: ansible_os_family == 'Debian' | ||
changed_when: false | ||
|
||
roles: | ||
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" |
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,29 @@ | ||
--- | ||
role_name_check: 1 | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: instance | ||
groups: | ||
- k3s_master | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
options: | ||
diff: true | ||
inventory: | ||
group_vars: | ||
k3s_master: | ||
k3s_master: true | ||
k3s_agent: | ||
k3s_agent: true | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-converge.yml} |
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 @@ | ||
molecule-plugins[docker] |
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,19 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
k3s_agent_extra_args: | ||
- "--snapshotter=native" | ||
k3s_master_extra_args: | ||
- "--snapshotter=native" | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
when: ansible_os_family == 'Debian' | ||
changed_when: false | ||
|
||
roles: | ||
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" |
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,29 @@ | ||
--- | ||
role_name_check: 1 | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: instance | ||
groups: | ||
- k3s_master | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
options: | ||
diff: true | ||
inventory: | ||
group_vars: | ||
k3s_master: | ||
k3s_master: true | ||
k3s_agent: | ||
k3s_agent: true | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-converge.yml} |
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
Oops, something went wrong.