Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): add optional in-memory cache to client #9521

Merged
merged 63 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
28401ca
initial api cache implementation
floreks Oct 14, 2024
0ec3afe
use single cache
maciaszczykm Oct 15, 2024
9259790
add token exchange
maciaszczykm Oct 15, 2024
e1f65b6
add args validation
maciaszczykm Oct 15, 2024
d034503
add a lock mechanism
maciaszczykm Oct 15, 2024
0f81a26
add arg for cache refresh
maciaszczykm Oct 15, 2024
e968a41
add more logging
floreks Oct 15, 2024
889b381
go mod tidy and add more logging
floreks Oct 15, 2024
aeb87c4
hash cache keys
maciaszczykm Oct 15, 2024
197124e
refactor client cache and replace print with klog in the api module
floreks Oct 15, 2024
2f378d1
make key fields private
maciaszczykm Oct 16, 2024
c0a170e
add error handler
maciaszczykm Oct 16, 2024
c48adaf
cache secrets
maciaszczykm Oct 16, 2024
223bf4e
fix secret kind
maciaszczykm Oct 16, 2024
00d23c5
cache nodes
maciaszczykm Oct 16, 2024
083fc65
cache namespaces
maciaszczykm Oct 16, 2024
430f836
cache persistent volumes
maciaszczykm Oct 16, 2024
71a6e3e
cache persistent volume claims
maciaszczykm Oct 16, 2024
2815992
move cache out of core package
maciaszczykm Oct 16, 2024
3fd8aad
fix import cycle
maciaszczykm Oct 16, 2024
d16c74e
fix sha generation and token exchange error handling
floreks Oct 16, 2024
1e8a164
fix build
maciaszczykm Oct 16, 2024
86819e2
Merge remote-tracking branch 'origin/api/cache' into api/cache
maciaszczykm Oct 16, 2024
02b6776
fix dependencies
maciaszczykm Oct 16, 2024
aad93f5
update log messages
floreks Oct 17, 2024
ebfab6c
Merge branch 'api/cache' of github.com:kubernetes/dashboard into api/…
floreks Oct 17, 2024
a26c178
add pprof/prometheus metrics handlers and synced load optimization
floreks Oct 18, 2024
f01a515
tiny refactor
floreks Oct 18, 2024
1471bad
build and push API image from PR
floreks Oct 21, 2024
1f04e09
ignore chart version bump check
floreks Oct 21, 2024
890b3f9
update ci helm action
floreks Oct 21, 2024
fc50190
store load locks in a map
maciaszczykm Oct 21, 2024
4289899
do not return nils
maciaszczykm Oct 21, 2024
8451643
fix nil pointer when user has no permissions to cache
floreks Oct 21, 2024
05509b7
small refactor
floreks Oct 21, 2024
c24dc37
add license headers
floreks Oct 21, 2024
80d4ba6
remove unused function
maciaszczykm Oct 22, 2024
68ba5fa
refactor
maciaszczykm Oct 22, 2024
bcabbd5
cleanup logging levels
floreks Oct 22, 2024
bea8c1a
Merge branch 'api/cache' of github.com:kubernetes/dashboard into api/…
floreks Oct 22, 2024
d8e3554
update args documentation
floreks Oct 22, 2024
a160905
update proxy mode arg doc
floreks Oct 22, 2024
edeadf9
add cache design documentation template
floreks Oct 22, 2024
50112e3
cache design doc: add motivation paragraph
floreks Oct 22, 2024
02f0e7a
update docs
maciaszczykm Oct 22, 2024
6190b23
Merge remote-tracking branch 'origin/api/cache' into api/cache
maciaszczykm Oct 22, 2024
fa2bead
update docs
maciaszczykm Oct 22, 2024
34e5ce2
cache design doc: initial draft
floreks Oct 22, 2024
880c3e4
Merge branch 'api/cache' of github.com:kubernetes/dashboard into api/…
floreks Oct 22, 2024
4371f50
add goals
maciaszczykm Oct 22, 2024
2499d4b
Merge remote-tracking branch 'origin/api/cache' into api/cache
maciaszczykm Oct 22, 2024
56d1636
merge goals
maciaszczykm Oct 22, 2024
a59ec66
ide suggestions
maciaszczykm Oct 22, 2024
6eb9120
merge goals
maciaszczykm Oct 22, 2024
f13ece9
add cache sequence diagram
floreks Oct 22, 2024
aaef3f9
Merge branch 'api/cache' of github.com:kubernetes/dashboard into api/…
floreks Oct 22, 2024
babefa6
update proposal section
floreks Oct 22, 2024
6cb9dbd
small changes
maciaszczykm Oct 22, 2024
1c58527
add second sequence diagram
floreks Oct 22, 2024
9e0a0df
Merge branch 'api/cache' of github.com:kubernetes/dashboard into api/…
floreks Oct 22, 2024
2fc00f4
start describing implementation
maciaszczykm Oct 22, 2024
bf7a937
Merge remote-tracking branch 'origin/api/cache' into api/cache
maciaszczykm Oct 22, 2024
616826a
update implementation paragraph
floreks Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/ci-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,31 @@ jobs:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- uses: azure/[email protected]
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.12.1
- uses: helm/[email protected]
- id: list-changed
- name: Set up Chart Testing CLI
uses: helm/[email protected]
- name: Change Detection
id: list-changed
run: |
changed=$(ct list-changed --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }}
- if: steps.list-changed.outputs.changed == 'true'
- name: Lint Chart
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config=.ct.yml --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false
- name: Set up Kind
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
with:
node_image: kindest/node:v1.30.2
- if: steps.list-changed.outputs.changed == 'true'
- name: Install Chart
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,62 @@ jobs:
fetch-depth: 0
- run: make image

publish:
name: Build and push API container
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docket meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/kubernetes/dashboard-api
docker.io/kubernetesui/dashboard-api
tags: |
type=sha
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.new_release_version }}
- name: Set up QEMU
uses: docker/[email protected]
- name: set up Docker Buildx
uses: docker/[email protected]
with:
config: .github/buildkitd.toml
- name: Login to Docker
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_RELEASE_USER }}
password: ${{ secrets.DOCKER_RELEASE_PASS }}
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
context: modules
file: modules/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version || 'latest' }}

unit-tests:
name: Unit tests with coverage
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions charts/kubernetes-dashboard/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Congratulations! You have just installed Kubernetes Dashboard in your cluster.
{{ if not (.Values.nginx.enabled) }}
To access Dashboard run:
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
kubectl -n {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-kong-proxy 8443:443

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

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

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