From bb5c5ffbe05c906ef944cf18083db64580173577 Mon Sep 17 00:00:00 2001 From: Dmytro Lisnichenko Date: Sat, 6 May 2023 23:39:54 +0300 Subject: [PATCH 1/2] Update documentation and versions, trigger tests for newer versions --- .gitignore | 4 +++ .travis.yml | 20 +++++++++--- README.md | 4 ++- defaults/main.yml | 2 +- .../{ubuntu_max => ubuntu_bionic}/INSTALL.rst | 0 .../molecule.yml | 4 +-- .../{ubuntu_min => ubuntu_focal}/INSTALL.rst | 0 molecule/ubuntu_focal/molecule.yml | 32 +++++++++++++++++++ molecule/ubuntu_jammy/INSTALL.rst | 22 +++++++++++++ molecule/ubuntu_jammy/molecule.yml | 32 +++++++++++++++++++ molecule/ubuntu_xenial/INSTALL.rst | 22 +++++++++++++ .../molecule.yml | 4 +-- 12 files changed, 136 insertions(+), 10 deletions(-) rename molecule/{ubuntu_max => ubuntu_bionic}/INSTALL.rst (100%) rename molecule/{ubuntu_max => ubuntu_bionic}/molecule.yml (85%) rename molecule/{ubuntu_min => ubuntu_focal}/INSTALL.rst (100%) create mode 100644 molecule/ubuntu_focal/molecule.yml create mode 100644 molecule/ubuntu_jammy/INSTALL.rst create mode 100644 molecule/ubuntu_jammy/molecule.yml create mode 100644 molecule/ubuntu_xenial/INSTALL.rst rename molecule/{ubuntu_min => ubuntu_xenial}/molecule.yml (85%) diff --git a/.gitignore b/.gitignore index d7f11a7..bacd603 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,10 @@ local.properties .loadpath .recommenders +# Intellij Idea +*.iml +.idea/* + # External tool builders .externalToolBuilders/ diff --git a/.travis.yml b/.travis.yml index 748cab9..b27c6dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,16 @@ jobs: - MOLECULE_SCENARIO=debian_min - env: - MOLECULEW_ANSIBLE=2.7.15 - - MOLECULE_SCENARIO=ubuntu_max + - MOLECULE_SCENARIO=ubuntu_jammy - env: - MOLECULEW_ANSIBLE=2.7.15 - - MOLECULE_SCENARIO=ubuntu_min + - MOLECULE_SCENARIO=ubuntu_focal + - env: + - MOLECULEW_ANSIBLE=2.7.15 + - MOLECULE_SCENARIO=ubuntu_bionic + - env: + - MOLECULEW_ANSIBLE=2.7.15 + - MOLECULE_SCENARIO=ubuntu_xenial - env: - MOLECULEW_ANSIBLE=2.9.1 - MOLECULE_SCENARIO=centos @@ -36,10 +42,16 @@ jobs: - MOLECULE_SCENARIO=debian_min - env: - MOLECULEW_ANSIBLE=2.9.1 - - MOLECULE_SCENARIO=ubuntu_max + - MOLECULE_SCENARIO=ubuntu_jammy + - env: + - MOLECULEW_ANSIBLE=2.9.1 + - MOLECULE_SCENARIO=ubuntu_focal + - env: + - MOLECULEW_ANSIBLE=2.9.1 + - MOLECULE_SCENARIO=ubuntu_bionic - env: - MOLECULEW_ANSIBLE=2.9.1 - - MOLECULE_SCENARIO=ubuntu_min + - MOLECULE_SCENARIO=ubuntu_xenial # Require Ubuntu 16.04 dist: xenial diff --git a/README.md b/README.md index df5ea31..d621e3a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Role to download and install [microk8s](https://microk8s.io/) the smallest, simp * Ubuntu * Xenial (16.04) * Bionic (18.04) + * Focal (20.04) (untested) + * Jammy (22.04) (untested) * Arch Linux (untested) ## License @@ -23,7 +25,7 @@ MIT Some variables available in this role are listed here. The full set is defined in `[defaults/main.yml](defaults/main.yml)`. -* `microk8s_version`: Version to use, defaults to `1.19/stable`. +* `microk8s_version`: Version to use, defaults to `1.27/stable`. * `microk8s_plugins`: Enable/disable various plugins. A string will be passed as `arg` when enabling addon using `name:arg` * `microk8s_enable_HA`: Enable/disable high-availability. * `microk8s_group_HA`: Hostgroup whose members will form HA cluster. diff --git a/defaults/main.yml b/defaults/main.yml index 5db982e..1cd16a6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,7 +4,7 @@ # # version management -microk8s_version: "1.22/stable" +microk8s_version: "1.27/stable" microk8s_disable_snap_autoupdate: false # plugin configuration diff --git a/molecule/ubuntu_max/INSTALL.rst b/molecule/ubuntu_bionic/INSTALL.rst similarity index 100% rename from molecule/ubuntu_max/INSTALL.rst rename to molecule/ubuntu_bionic/INSTALL.rst diff --git a/molecule/ubuntu_max/molecule.yml b/molecule/ubuntu_bionic/molecule.yml similarity index 85% rename from molecule/ubuntu_max/molecule.yml rename to molecule/ubuntu_bionic/molecule.yml index 26e0949..2adea37 100644 --- a/molecule/ubuntu_max/molecule.yml +++ b/molecule/ubuntu_bionic/molecule.yml @@ -11,7 +11,7 @@ lint: | ansible-lint . platforms: - - name: ansible_role_microk8s_ubuntu_max + - name: ansible_role_microk8s_ubuntu_bionic image: ubuntu:18.04 dockerfile: ../default/Dockerfile.j2 @@ -23,7 +23,7 @@ provisioner: name: ansible-lint scenario: - name: ubuntu_max + name: ubuntu_bionic verifier: name: testinfra diff --git a/molecule/ubuntu_min/INSTALL.rst b/molecule/ubuntu_focal/INSTALL.rst similarity index 100% rename from molecule/ubuntu_min/INSTALL.rst rename to molecule/ubuntu_focal/INSTALL.rst diff --git a/molecule/ubuntu_focal/molecule.yml b/molecule/ubuntu_focal/molecule.yml new file mode 100644 index 0000000..71ef5cb --- /dev/null +++ b/molecule/ubuntu_focal/molecule.yml @@ -0,0 +1,32 @@ +--- +dependency: + name: galaxy + +driver: + name: docker + +lint: | + set -e + yamllint . + ansible-lint . + +platforms: + - name: ansible_role_microk8s_ubuntu_focal + image: ubuntu:20.04 + dockerfile: ../default/Dockerfile.j2 + +provisioner: + name: ansible + playbooks: + converge: ../default/playbook.yml + lint: + name: ansible-lint + +scenario: + name: ubuntu_focal + +verifier: + name: testinfra + directory: ../default/tests + lint: + name: flake8 diff --git a/molecule/ubuntu_jammy/INSTALL.rst b/molecule/ubuntu_jammy/INSTALL.rst new file mode 100644 index 0000000..6a44bde --- /dev/null +++ b/molecule/ubuntu_jammy/INSTALL.rst @@ -0,0 +1,22 @@ +******* +Docker driver installation guide +******* + +Requirements +============ + +* Docker Engine + +Install +======= + +Please refer to the `Virtual environment`_ documentation for installation best +practices. If not using a virtual environment, please consider passing the +widely recommended `'--user' flag`_ when invoking ``pip``. + +.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ +.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site + +.. code-block:: bash + + $ pip install 'molecule[docker]' diff --git a/molecule/ubuntu_jammy/molecule.yml b/molecule/ubuntu_jammy/molecule.yml new file mode 100644 index 0000000..98ab756 --- /dev/null +++ b/molecule/ubuntu_jammy/molecule.yml @@ -0,0 +1,32 @@ +--- +dependency: + name: galaxy + +driver: + name: docker + +lint: | + set -e + yamllint . + ansible-lint . + +platforms: + - name: ansible_role_microk8s_ubuntu_jammy + image: ubuntu:22.04 + dockerfile: ../default/Dockerfile.j2 + +provisioner: + name: ansible + playbooks: + converge: ../default/playbook.yml + lint: + name: ansible-lint + +scenario: + name: ubuntu_jammy + +verifier: + name: testinfra + directory: ../default/tests + lint: + name: flake8 diff --git a/molecule/ubuntu_xenial/INSTALL.rst b/molecule/ubuntu_xenial/INSTALL.rst new file mode 100644 index 0000000..6a44bde --- /dev/null +++ b/molecule/ubuntu_xenial/INSTALL.rst @@ -0,0 +1,22 @@ +******* +Docker driver installation guide +******* + +Requirements +============ + +* Docker Engine + +Install +======= + +Please refer to the `Virtual environment`_ documentation for installation best +practices. If not using a virtual environment, please consider passing the +widely recommended `'--user' flag`_ when invoking ``pip``. + +.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ +.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site + +.. code-block:: bash + + $ pip install 'molecule[docker]' diff --git a/molecule/ubuntu_min/molecule.yml b/molecule/ubuntu_xenial/molecule.yml similarity index 85% rename from molecule/ubuntu_min/molecule.yml rename to molecule/ubuntu_xenial/molecule.yml index aaa4a38..1bb92b2 100644 --- a/molecule/ubuntu_min/molecule.yml +++ b/molecule/ubuntu_xenial/molecule.yml @@ -11,7 +11,7 @@ lint: | ansible-lint . platforms: - - name: ansible_role_microk8s_ubuntu_min + - name: ansible_role_microk8s_ubuntu_xenial image: ubuntu:16.04 dockerfile: ../default/Dockerfile.j2 @@ -23,7 +23,7 @@ provisioner: name: ansible-lint scenario: - name: ubuntu_min + name: ubuntu_xenial verifier: name: testinfra From 8e0b5d9dde479ac442443aa42b8abf135bb552d9 Mon Sep 17 00:00:00 2001 From: Dmytro Lisnichenko Date: Sun, 7 May 2023 23:36:25 +0300 Subject: [PATCH 2/2] update deprecated storage plugin name to hostpath-storage --- README.md | 2 ++ defaults/main.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d621e3a..c0b8735 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ defined in `[defaults/main.yml](defaults/main.yml)`. istio: true ingress: true ``` +Note: when overriding plugins list, it is recommended to copy-paste the entire list of plugins from the +`defaults/main.yml` because some Ansible tasks reference them (e.g. `helm3`) and the deployment may fail. ### Custom certificate request template diff --git a/defaults/main.yml b/defaults/main.yml index 1cd16a6..6aa0689 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,7 +16,7 @@ microk8s_plugins: ingress: true # Ingress controller for external access metrics-server: true # K8s Metrics Server for API access to service metrics rbac: true # Role-Based Access Control for authorisation - storage: true # Storage class; allocates storage from host directory + hostpath-storage: true # Storage class; allocates storage from host directory registry: "size={{ registry_size }}" # Private image registry exposed on localhost:32000 dashboard: true # The Kubernetes dashboard ambassador: false # Ambassador API Gateway and Ingress