Skip to content

Commit 9d28815

Browse files
feat(client): add optional in-memory cache to client (#9521)
* initial api cache implementation * use single cache * add token exchange * add args validation * add a lock mechanism * add arg for cache refresh * add more logging * go mod tidy and add more logging * hash cache keys * refactor client cache and replace print with klog in the api module * make key fields private * add error handler * cache secrets * fix secret kind * cache nodes * cache namespaces * cache persistent volumes * cache persistent volume claims * move cache out of core package * fix import cycle * fix sha generation and token exchange error handling * fix build * fix dependencies * update log messages * add pprof/prometheus metrics handlers and synced load optimization * tiny refactor * build and push API image from PR * ignore chart version bump check * update ci helm action * store load locks in a map * do not return nils * fix nil pointer when user has no permissions to cache * small refactor * add license headers * remove unused function * refactor * cleanup logging levels * update args documentation * update proxy mode arg doc * add cache design documentation template * cache design doc: add motivation paragraph * update docs * update docs * cache design doc: initial draft * add goals * merge goals * ide suggestions * merge goals * add cache sequence diagram * update proposal section * small changes * add second sequence diagram * start describing implementation * update implementation paragraph --------- Co-authored-by: Marcin Maciaszczyk <[email protected]>
1 parent 7411227 commit 9d28815

File tree

112 files changed

+1876
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1876
-274
lines changed

.github/workflows/ci-helm.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,31 @@ jobs:
2323
name: Lint and test
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/[email protected]
26+
- name: Checkout
27+
uses: actions/[email protected]
2728
with:
2829
fetch-depth: 0
29-
- uses: azure/[email protected]
30+
- name: Set up Helm
31+
uses: azure/[email protected]
3032
with:
3133
version: v3.12.1
32-
- uses: helm/[email protected]
33-
- id: list-changed
34+
- name: Set up Chart Testing CLI
35+
uses: helm/[email protected]
36+
- name: Change Detection
37+
id: list-changed
3438
run: |
3539
changed=$(ct list-changed --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }})
3640
if [[ -n "$changed" ]]; then
3741
echo "changed=true" >> "$GITHUB_OUTPUT"
3842
fi
39-
- if: steps.list-changed.outputs.changed == 'true'
40-
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }}
41-
- if: steps.list-changed.outputs.changed == 'true'
43+
- name: Lint Chart
44+
if: steps.list-changed.outputs.changed == 'true'
45+
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false
46+
- name: Set up Kind
47+
if: steps.list-changed.outputs.changed == 'true'
4248
uses: helm/[email protected]
4349
with:
4450
node_image: kindest/node:v1.30.2
45-
- if: steps.list-changed.outputs.changed == 'true'
51+
- name: Install Chart
52+
if: steps.list-changed.outputs.changed == 'true'
4653
run: ct install --target-branch ${{ github.event.repository.default_branch }}

.github/workflows/ci.yml

+56
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,62 @@ jobs:
116116
fetch-depth: 0
117117
- run: make image
118118

119+
publish:
120+
name: Build and push API container
121+
runs-on: ubuntu-latest
122+
permissions:
123+
contents: read
124+
id-token: write
125+
packages: write
126+
steps:
127+
- name: Checkout
128+
uses: actions/checkout@v4
129+
with:
130+
fetch-depth: 0
131+
- name: Docket meta
132+
id: meta
133+
uses: docker/metadata-action@v5
134+
with:
135+
images: |
136+
ghcr.io/kubernetes/dashboard-api
137+
docker.io/kubernetesui/dashboard-api
138+
tags: |
139+
type=sha
140+
type=ref,event=pr
141+
type=ref,event=branch
142+
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.new_release_version }}
143+
- name: Set up QEMU
144+
uses: docker/[email protected]
145+
- name: set up Docker Buildx
146+
uses: docker/[email protected]
147+
with:
148+
config: .github/buildkitd.toml
149+
- name: Login to Docker
150+
uses: docker/[email protected]
151+
with:
152+
username: ${{ secrets.DOCKER_RELEASE_USER }}
153+
password: ${{ secrets.DOCKER_RELEASE_PASS }}
154+
- name: Login to GHCR
155+
uses: docker/[email protected]
156+
with:
157+
registry: ghcr.io
158+
username: ${{ github.actor }}
159+
password: ${{ secrets.GITHUB_TOKEN }}
160+
- name: Build and push
161+
id: push
162+
uses: docker/build-push-action@v6
163+
with:
164+
context: modules
165+
file: modules/api/Dockerfile
166+
push: true
167+
tags: ${{ steps.meta.outputs.tags }}
168+
labels: ${{ steps.meta.outputs.labels }}
169+
platforms: linux/amd64
170+
cache-from: type=gha
171+
cache-to: type=gha,mode=max
172+
build-args: |
173+
VERSION=${{ steps.meta.outputs.version || 'latest' }}
174+
119175
unit-tests:
120176
name: Unit tests with coverage
121177
runs-on: ubuntu-latest

charts/kubernetes-dashboard/templates/NOTES.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Congratulations! You have just installed Kubernetes Dashboard in your cluster.
66
{{ if not (.Values.nginx.enabled) }}
77
To access Dashboard run:
8-
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
8+
kubectl -n {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-kong-proxy 8443:443
99

1010
NOTE: In case port-forward command does not work, make sure that kong service name is correct.
1111
Check the services in Kubernetes Dashboard namespace using:
@@ -17,7 +17,7 @@ Dashboard will be available at:
1717

1818
{{ if and (has "localhost" .Values.app.ingress.hosts) (eq .Values.app.ingress.ingressClassName "internal-nginx") (.Values.nginx.enabled) }}
1919
To access Dashboard run:
20-
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-nginx-controller 8443:443
20+
kubectl -n {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-nginx-controller 8443:443
2121

2222
NOTE: In case port-forward command does not work, make sure that nginx service name is correct.
2323
Check the services in Kubernetes Dashboard namespace using:

0 commit comments

Comments
 (0)