-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
❇️ support namespaced installation (#16)
* ❇️ initial pass at namespaced installation * 🚀 add chart testing to build step since features depend on build * 🐛 fix arg setting * 🐛 python string of csv * 🐛 redirect to api base url * 🐛 return json response for api denials * ♻️ remove allowed_ns from returned error * 🔧 catch an unset namespace in namespaced mode * 📝 document the namespaced mode feature * 📝 license badge
- Loading branch information
Showing
10 changed files
with
135 additions
and
8 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 |
---|---|---|
|
@@ -59,3 +59,39 @@ jobs: | |
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
test-deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.12.0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (lint) | ||
run: | | ||
ct lint --charts chart/kronic --target-branch ${{ github.event.repository.default_branch }} | ||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (install) | ||
run: | | ||
ct install --charts chart/kronic \ | ||
--helm-extra-args '--timeout 60s' \ | ||
--helm-extra-set-args '--set=image.tag=${{ needs.build.outputs.releaseTag }}' \ | ||
--target-branch ${{ github.event.repository.default_branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ ingress: | |
auth: | ||
enabled: true | ||
secretName: custom-basic-auth | ||
|
||
env: | ||
KRONIC_NAMESPACE_ONLY: "true" |
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
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 |
---|---|---|
@@ -1,7 +1,27 @@ | ||
import logging | ||
import os | ||
import sys | ||
|
||
log = logging.getLogger("app.config") | ||
|
||
## Configuration | ||
# Comma separated list of namespaces to allow access to | ||
ALLOW_NAMESPACES = os.environ.get("KRONIC_ALLOW_NAMESPACES", None) | ||
|
||
# Boolean of whether this is a test environment, disables kubeconfig setup | ||
TEST = os.environ.get("KRONIC_TEST", False) | ||
|
||
# Limit to local namespace. Supercedes `ALLOW_NAMESPACES` | ||
NAMESPACE_ONLY = os.environ.get("KRONIC_NAMESPACE_ONLY", False) | ||
|
||
# Set allowed namespaces to the installed namespace only | ||
if NAMESPACE_ONLY: | ||
try: | ||
KRONIC_NAMESPACE = os.environ["KRONIC_NAMESPACE"] | ||
except KeyError as e: | ||
log.error( | ||
"ERROR: KRONIC_NAMESPACE variable not set and a NAMESPACE_ONLY mode was specified." | ||
) | ||
sys.exit(1) | ||
|
||
ALLOW_NAMESPACES = KRONIC_NAMESPACE |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{% extends 'base.html' %} | ||
{% block content %} | ||
<h2>{% block title %}Access denied to {{data.namespace}}{% endblock %}</h2> | ||
<p>Namespaces allowed: {{data.allowed_namespaces}}</p> | ||
<p>{{data.error}}</p> | ||
|
||
{% endblock %} | ||
{% endblock %} |