Skip to content

Commit

Permalink
Feature/jdb/strict merge (#2742)
Browse files Browse the repository at this point in the history
* Include ingress for addon status check

* Add addon to expose dashboard over ingress (#906)

* Add validator for dashboard-ingress (#906)

* Add note and workaround for nip.io in tests

* Force HTTPS redirect on dashboard ingress

* Fix lint on validator changes at dashboard_ingress

* Add config args to dashboard-ingress addon (#906)

* fix unclosed monospace text on nip.io workaround

* Move storage-dir argument to k8s-dqlite (#2672)

* Move storage-dir argument to k8s-dqlite

* Fix the config values

* Remove empty line

* Use Docker's own registry image (#2679)

* Update k8s-dqlite to include the empty cluster.yaml fix (#2683)

* Upgrade linkerd to version 2.11.1

* Fix yaml loading in tests (#2698)

* Update EnVar plugin (#2704)

* Installer 2.2.1 release (#2705)

* Bump actions/checkout from 2.3.5 to 2.4.0 (#2706)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2.3.5...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update inaccel add-on (#2681)

* Set `kube-system` as the default namespace

* Test mutating webhook features

Signed-off-by: Elias Koromilas <elias.koromilas@gmail.com>

* Inspect report to include basic dqlite info (#2688)

* Update check-formatting.yml (#2721)

Rename `build` to `check-formatting`.  This helps when running locally with `act`.

* Add clustering tests. Remove dead tests. (#2697)

* Update GPU operator to v1.8.2 and fix its test (#2708)

* updated portainer disable script (#2693)

* Update default kube-apiserver arguments (#2731)

- Disable profiling (--profiling=false)
- Reduce event TTL to 5 minutes (--event-ttl=5m)

* Bump ingress to v1.0.5 (#2732)

* Bump actions/setup-python from 2.2.2 to 2.3.0 (#2738)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2.2.2 to 2.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v2.2.2...v2.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use SafeLoader instead of FullLoader (#2726)

* Pull inspection tarball out of the multipass VM (#2711)

Co-authored-by: John P Lettman <john.lettman@canonical.com>
Co-authored-by: Konstantinos Tsakalozos <kos.tsakalozos@canonical.com>
Co-authored-by: Tobias Muehl <t@muehl.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Elias Koromilas <elias.koromilas@gmail.com>
Co-authored-by: balasu <balasundarammaster@gmail.com>
Co-authored-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
Co-authored-by: Mohammad Faraz <farazm708@gmail.com>
  • Loading branch information
9 people committed Nov 23, 2021
1 parent c98c417 commit 2d526d2
Show file tree
Hide file tree
Showing 46 changed files with 403 additions and 1,286 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
working-directory: ${{ github.workspace }}/installer/windows
steps:
- name: Checkout
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0
- name: Set up Python 3.8
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v2.3.0
with:
python-version: 3.8
- name: Install Python requirements
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Download EnVar plugin for NSIS
uses: carlosperate/download-file-action@v1.0.3
with:
file-url: https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip
file-url: https://github.com/GsNSIS/EnVar/releases/download/v0.3.1/EnVar-Plugin.zip
file-name: envar_plugin.zip
location: ${{ github.workspace }}
- name: Extract EnVar plugin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checking out repo
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0
- name: Install lxd
run: |
sudo lxd init --auto
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
- pull_request

jobs:
build:
check-formatting:
name: Check Formatting
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-kubeflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checking out repo
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0

- name: Install lxd
run: |
Expand All @@ -43,7 +43,7 @@ jobs:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0

- name: Download built snap
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
bundle: [full, lite]
steps:
- name: Check out code
uses: actions/checkout@v2.3.5
uses: actions/checkout@v2.4.0

- name: Download built snap
uses: actions/download-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/set-env-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else
fi

export KUBERNETES_TAG="${KUBE_VERSION}"
export K8S_DQLITE_TAG="${K8S_DQLITE_TAG:-v1.0.1}"
export K8S_DQLITE_TAG="${K8S_DQLITE_TAG:-v1.0.2}"

export KUBE_SNAP_ROOT="$(readlink -f .)"

Expand Down
8 changes: 8 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,11 @@ cd tests/
pytest -s test-addons.py
pytest -s test-upgrade.py
```

Note: the `ingress` and `dashboard-ingress` tests make use of nip.io for wildcard ingress domains on localhost. [DNS rebinding protection](https://en.wikipedia.org/wiki/DNS_rebinding) may prevent the resolution of the domains used in the tests.

A workaround is adding these entries to `/etc/hosts`:
```
127.0.0.1 kubernetes-dashboard.127.0.0.1.nip.io
127.0.0.1 microbot.127.0.0.1.nip.io
```
42 changes: 42 additions & 0 deletions installer/cli/microk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import traceback
from typing import List
from sys import exit, platform
from os import getcwd

import click

Expand Down Expand Up @@ -56,6 +57,9 @@ def cli(ctx, help):
elif ctx.args[0] == "dashboard-proxy":
dashboard_proxy()
exit(0)
elif ctx.args[0] == "inspect":
inspect()
exit(0)
else:
run(ctx.args)
exit(0)
Expand Down Expand Up @@ -211,6 +215,44 @@ def kubectl(args) -> int:
return Linux(args).kubectl()


def inspect() -> None:
vm_provider_name = "multipass"
vm_provider_class = get_provider_for(vm_provider_name)
echo = Echo()
try:
vm_provider_class.ensure_provider()
instance = vm_provider_class(echoer=echo)
instance.get_instance_info()

command = ["microk8s.inspect"]
output = instance.run(command, hide_output=True)
tarball_location = None
host_destination = getcwd()
if b"Report tarball is at" not in output:
echo.error("Report tarball not generated")
else:
for line_out in output.split(b"\n"):
line_out = line_out.decode()
line = line_out.strip()
if line.startswith("Report tarball is at "):
tarball_location = line.split("Report tarball is at ")[1]
break
echo.wrapped(line_out)
if not tarball_location:
echo.error("Cannot find tarball file location")
else:
instance.pull_file(name=tarball_location, destination=host_destination)
echo.wrapped(
"The report tarball {} is stored on the current directory".format(
tarball_location.split("/")[-1]
)
)

except ProviderInstanceNotFoundError:
_not_installed(echo)
return 1


def dashboard_proxy() -> None:
vm_provider_name = "multipass"
vm_provider_class = get_provider_for(vm_provider_name)
Expand Down
2 changes: 1 addition & 1 deletion installer/windows/microk8s.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!include "Sections.nsh"

!define PRODUCT_NAME "MicroK8s"
!define PRODUCT_VERSION "2.2.0"
!define PRODUCT_VERSION "2.2.1"
!define PRODUCT_PUBLISHER "Canonical"
!define MUI_ICON ".\microk8s.ico"
!define MUI_HEADERIMAGE
Expand Down
37 changes: 37 additions & 0 deletions microk8s-resources/actions/disable.dashboard-ingress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python3

import os
import subprocess

import click

@click.command()
def dashboard_ingress():
click.echo("Disabling Ingress for Kubernetes Dashboard")

env = os.environ.copy()
env["PATH"] += ":%s" % os.environ["SNAP"]

resources = [
"secret/kubernetes-dashboard-basic-auth",
"ingress.networking.k8s.io/kubernetes-dashboard-ingress"
]

for resource in resources:
click.echo(f"Destroying {resource}...")
try:
subprocess.check_call(
["microk8s-kubectl.wrapper", "delete", "-n", "kube-system", resource],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,
)
except subprocess.CalledProcessError:
pass

click.echo("Destruction complete.")
click.echo("Ingress for Kubernetes Dashboard is disabled")

if __name__ == "__main__":
dashboard_ingress(prog_name="microk8s disable dashboard-ingress")
4 changes: 3 additions & 1 deletion microk8s-resources/actions/disable.inaccel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source $SNAP/actions/common/utils.sh

echo "Disabling InAccel FPGA Operator"

"$SNAP/microk8s-helm3.wrapper" uninstall inaccel
"$SNAP/microk8s-helm3.wrapper" uninstall inaccel \
--namespace kube-system \
$@

echo "InAccel is disabled"
8 changes: 2 additions & 6 deletions microk8s-resources/actions/disable.portainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ source $SNAP/actions/common/utils.sh

NAMESPACE_PTR="portainer"

MANIFEST_PTR="https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml"

KUBECTL="$SNAP/kubectl --kubeconfig=${SNAP_DATA}/credentials/client.config"

KUBECTL_DELETE_ARGS="--wait=true --timeout=180s --ignore-not-found=true"

echo "Disabling Portainer"

# unload the the manifests
$KUBECTL delete $KUBECTL_DELETE_ARGS -n $NAMESPACE_PTR -f "$MANIFEST_PTR" > /dev/null 2>&1
$KUBECTL delete $KUBECTL_DELETE_ARGS -n $NAMESPACE_PTR deployment,service,pods --all > /dev/null 2>&1

# delete the "portainer" namespace
$KUBECTL delete $KUBECTL_DELETE_ARGS namespace "$NAMESPACE_PTR" > /dev/null 2>&1 || true

echo "Portainer is disabled"
echo "Portainer deployment is disabled"
Loading

0 comments on commit 2d526d2

Please sign in to comment.