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..c0b8735 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. @@ -43,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 5db982e..6aa0689 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 @@ -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 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