From 512dea10b6b342bab485b5b64e20834cbcf4e854 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 17 Feb 2024 13:40:00 +0100 Subject: [PATCH] feat(kubeapps): add support for tokenless login (#18259) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** This adds alpha code to test if we can make kubeapps work without pesky token login. **โš™๏ธ Type of change** - [ ] โš™๏ธ Feature/App addition - [ ] ๐Ÿช› Bugfix - [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] ๐Ÿ”ƒ Refactor of current code **๐Ÿงช How Has This Been Tested?** **๐Ÿ“ƒ Notes:** For production use of this, users should explicitly: A. Setup NetworkPolicies B. Add a GOOD authentication proxy in front **โœ”๏ธ Checklist:** - [ ] โš–๏ธ My code follows the style guidelines of this project - [ ] ๐Ÿ‘€ I have performed a self-review of my own code - [ ] #๏ธโƒฃ I have commented my code, particularly in hard-to-understand areas - [ ] ๐Ÿ“„ I have made corresponding changes to the documentation - [ ] โš ๏ธ My changes generate no new warnings - [ ] ๐Ÿงช I have added tests to this description that prove my fix is effective or that my feature works - [ ] โฌ†๏ธ I increased versions for any altered app according to semantic versioning **โž• App addition** If this PR is an app addition please make sure you have done the following. - [ ] ๐Ÿ–ผ๏ธ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Kjeld Schouten Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> --- .github/workflows/catalog-test.yaml | 2 +- charts/enterprise/kubeapps/Chart.yaml | 6 +-- charts/enterprise/kubeapps/questions.yaml | 26 ++++++++- charts/enterprise/kubeapps/values.yaml | 65 ++++++++++++++++------- 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/.github/workflows/catalog-test.yaml b/.github/workflows/catalog-test.yaml index 5471d26b750..4ae65369dde 100644 --- a/.github/workflows/catalog-test.yaml +++ b/.github/workflows/catalog-test.yaml @@ -15,7 +15,7 @@ jobs: name: Test SCALE Catalog runs-on: ubuntu-latest container: - image: tccr.io/tccr/devcontainer:4.0.0 + image: tccr.io/tccr/devcontainer:v4.0.0 steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 name: Checkout diff --git a/charts/enterprise/kubeapps/Chart.yaml b/charts/enterprise/kubeapps/Chart.yaml index a551408c2a6..b7989e13d3e 100644 --- a/charts/enterprise/kubeapps/Chart.yaml +++ b/charts/enterprise/kubeapps/Chart.yaml @@ -10,7 +10,7 @@ apiVersion: v2 appVersion: latest dependencies: - name: common - version: 17.3.9 + version: 17.4.2 repository: oci://tccr.io/truecharts condition: "" alias: "" @@ -20,7 +20,7 @@ dependencies: version: 14.3.3 repository: https://charts.bitnami.com/bitnami condition: "" - alias: kubeapps + alias: ogkubeapps tags: [] import-values: [] deprecated: false @@ -42,4 +42,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/enterprise/kubeapps - https://github.com/truecharts/containers/tree/master/apps/alpine type: application -version: 1.0.0 +version: 1.1.0 diff --git a/charts/enterprise/kubeapps/questions.yaml b/charts/enterprise/kubeapps/questions.yaml index 4ac699c6a7c..c2c6757bfdb 100644 --- a/charts/enterprise/kubeapps/questions.yaml +++ b/charts/enterprise/kubeapps/questions.yaml @@ -5,8 +5,30 @@ portals: questions: # Include{global} # Include{serviceRoot} + - variable: main + label: "token-bypass Service" + description: "The token-bypass service" + schema: + additional_attrs: true + type: dict + attrs: +# Include{serviceSelectorLoadBalancer} +# Include{serviceSelectorExtras} + - variable: main + label: "token-bypass Service Port Configuration" + schema: + additional_attrs: true + type: dict + attrs: + - variable: port + label: "Port" + description: "This port exposes the container port on the service" + schema: + type: int + default: 8080 + required: true - variable: tckubeapps - label: "Main Service" + label: "KubeApps Service" description: "The Primary service on which the healthcheck runs, often the webUI" schema: additional_attrs: true @@ -15,7 +37,7 @@ questions: # Include{serviceSelectorLoadBalancer} # Include{serviceSelectorExtras} - variable: tckubeapps - label: "Main Service Port Configuration" + label: "KubeApps Service Port Configuration" schema: additional_attrs: true type: dict diff --git a/charts/enterprise/kubeapps/values.yaml b/charts/enterprise/kubeapps/values.yaml index 2e9a0445429..21c41cc9fe5 100644 --- a/charts/enterprise/kubeapps/values.yaml +++ b/charts/enterprise/kubeapps/values.yaml @@ -1,28 +1,60 @@ image: pullPolicy: IfNotPresent - repository: tccr.io/tccr/alpine - tag: latest@sha256:ade0065e19edaa4f6903d464ee70605111a48394536deb94f31b661264704558 -manifestManager: - enabled: false + repository: ghcr.io/xstar97/my-proxy-service + tag: v0.0.2@sha256:8d25a6ff316f140be1f198376e84208902ddf61a38a78076c1b11a81924d4019 + operator: register: false + portal: open: - enabled: false + enabled: true + +podOptions: + automountServiceAccountToken: true + workload: main: - enabled: false + enabled: true + primary: true + type: Deployment + podSpec: + containers: + main: + enabled: true + primary: true + env: + PORT: 3000 + API_FILE: /var/run/secrets/kubernetes.io/serviceaccount/token + PROXY_TARGET: http://tckubeapps:8080 + probes: + liveness: + enabled: true + type: tcp + port: 3000 + readiness: + enabled: true + type: tcp + port: 3000 + startup: + enabled: true + type: tcp + port: 3000 service: main: - enabled: false - ports: - main: - enabled: false - tckubeapps: enabled: true primary: true expandObjectName: false + ports: + main: + enabled: true + primary: true + port: 3000 + targetPort: 3000 + tckubeapps: + enabled: true + expandObjectName: false labels: truecharts.org/flagged: "true" selectorLabels: @@ -39,14 +71,7 @@ serviceAccount: kubeapps-operator: enabled: true primary: true - -secret: - kubeapps-operator-token: - enabled: true - type: kubernetes.io/service-account-token - annotations: - kubernetes.io/service-account.name: kubeapps-operator - stringData: "-" + targetSelectAll: true rbac: kubeapps-operator: @@ -59,7 +84,7 @@ rbac: resources: ["*"] verbs: ["*"] -kubeapps: +ogkubeapps: frontend: podLabels: truecharts.org/kahack: frontend