Updated CHANGELOG and molecule tests

This commit is contained in:
Xan Manning 2021-05-27 18:13:55 +00:00
parent c36c026783
commit e5b9e5a78a
6 changed files with 96 additions and 3 deletions

26
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
ARG VARIANT=focal
FROM ubuntu:${VARIANT}
COPY molecule/requirements.txt /tmp/molecule/requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install curl git python3-dev python3-pip \
python3-venv shellcheck sudo unzip docker.io jq \
&& curl -L \
"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
-o /usr/bin/kubectl \
&& chmod +x /usr/bin/kubectl \
&& python3 -m pip install pip --upgrade \
&& python3 -m pip install -r /tmp/molecule/requirements.txt
RUN useradd -m vscode && \
usermod -aG docker vscode && \
echo 'vscode ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/vscode && \
echo 'source /etc/bash_completion.d/git-prompt' >> /home/vscode/.bashrc && \
echo 'sudo chown vscode /var/run/docker-host.sock' >> /home/vscode/.bashrc && \
echo 'export PS1="${PS1}\[\033[38;5;196m\]$(__git_ps1)\[$(tput sgr0)\] "' >> /home/vscode/.bashrc
RUN ln -s /var/run/docker-host.sock /var/run/docker.sock
USER vscode

View File

@ -0,0 +1,28 @@
{
"name": "Ubuntu",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": { "VARIANT": "focal" }
},
"settings": {
"terminal.integrated.profiles.linux": {
"bash (login)": {
"path": "/bin/bash",
"args": ["-l"]
}
}
},
"extensions": [
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml"
],
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
],
"remoteUser": "vscode"
}

View File

@ -14,6 +14,19 @@
---
-->
## 2021-05-27, v2.10.0
### Notable changes
- Only deploy templates on primary controller #119
- Allow control plane static pods #120
- Add support for specifying URLs in templates #124
### Contributors
- [@bjw-s](https://github.com/bjw-s)
- [@onedr0p](https://github.com/onedr0p)
## 2021-05-14, v2.9.1
<!-- Today was a better day... <3 -->

View File

@ -71,9 +71,9 @@ consistency. These are generally cluster-level configuration.
| `k3s_github_url` | Set the GitHub URL to install k3s from. | https://github.com/k3s-io/k3s |
| `k3s_install_dir` | Installation directory for k3s. | `/usr/local/bin` |
| `k3s_install_hard_links` | Install using hard links rather than symbolic links. | `false` |
| `k3s_server_manifests_urls` | A list of URLs (w/ url and filename) to deploy on the primary control plane. | [] |
| `k3s_server_manifests_urls` | A list of URLs to deploy on the primary control plane. Read notes below. | [] |
| `k3s_server_manifests_templates` | A flat list of templates to deploy on the primary control plane. | [] |
| `k3s_server_pod_manifests_urls` | A list of URLs (w/ url and filename) for installing static pod manifests on the control plane. | [] |
| `k3s_server_pod_manifests_urls` | A list of URLs for installing static pod manifests on the control plane. Read notes below. | [] |
| `k3s_server_pod_manifests_templates` | A flat list of templates for installing static pod manifests on the control plane. | [] |
| `k3s_use_experimental` | Allow the use of experimental features in k3s. | `false` |
| `k3s_use_unsupported_config` | Allow the use of unsupported configurations in k3s. | `false` |
@ -298,6 +298,25 @@ ensure a majority in the event of a network partition. If you want to use 2
members or an even number of members, please set `k3s_use_unsupported_config`
to `true`.
#### Important note about `k3s_server_manifests_urls` and `k3s_server_pod_manifests_urls`
To deploy server manifests and server pod manifests from URL, you need to
specify a `url` and a `filename`. Below is an example of how to deploy the
Tigera operator for Calico and kube-vip.
```yaml
---
k3s_server_manifests_urls:
- url: https://docs.projectcalico.org/archive/v3.19/manifests/tigera-operator.yaml
filename: tigera-operator.yaml
k3s_server_pod_manifests_urls:
- url: https://raw.githubusercontent.com/kube-vip/kube-vip/main/example/deploy/0.1.4.yaml
filename: kube-vip.yaml
```
## Dependencies
No dependencies on other roles.

View File

@ -40,12 +40,16 @@ k3s_server_manifests_templates: []
# A list of URLs used for preconfigure the cluster.
k3s_server_manifests_urls: []
# - url: https://some/url/to/manifest.yml
# filename: manifest.yml
# A list of templates used for installing static pod manifests on the control plane.
k3s_server_pod_manifests_templates: []
# A list of URLs used for installing static pod manifests on the control plane.
k3s_server_pod_manifests_urls: []
# - url: https://some/url/to/manifest.yml
# filename: manifest.yml
# Use experimental features in k3s?
k3s_use_experimental: false
@ -128,4 +132,4 @@ k3s_registries:
# # path to the key file used in the registry
# key_file:
# # path to the ca file used in the registry
# ca_file:
# ca_file:

View File

@ -13,5 +13,8 @@
default-local-storage-path: /var/lib/k3s-io/local-storage
k3s_server_manifests_templates:
- "molecule/autodeploy/templates/00-ns-monitoring.yml.j2"
k3s_server_manifests_urls:
- url: https://raw.githubusercontent.com/metallb/metallb/v0.9.6/manifests/namespace.yaml
filename: 05-metallb-namespace.yml
roles:
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"