Skip to content

Commit

Permalink
Merge branch 'master' into fix-workload-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
HanNguyen-dev committed Dec 20, 2024
2 parents fc0fa51 + 4f3d800 commit 02dd071
Show file tree
Hide file tree
Showing 233 changed files with 7,793 additions and 4,690 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cd-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
type=raw,value=latest
type=match,pattern=\d+\.\d+\.\d+
type=sha
- uses: docker/setup-qemu-action@v3.1.0
- uses: docker/setup-buildx-action@v3.4.0
- uses: docker/setup-qemu-action@v3.2.0
- uses: docker/setup-buildx-action@v3.8.0
with:
config: .github/buildkitd.toml
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_RELEASE_USER }}
password: ${{ secrets.DOCKER_RELEASE_PASS }}
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
type=raw,value=latest
type=match,pattern=\d+\.\d+\.\d+
type=sha
- uses: docker/setup-qemu-action@v3.1.0
- uses: docker/setup-buildx-action@v3.4.0
- uses: docker/setup-qemu-action@v3.2.0
- uses: docker/setup-buildx-action@v3.8.0
with:
config: .github/buildkitd.toml
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_RELEASE_USER }}
password: ${{ secrets.DOCKER_RELEASE_PASS }}
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: helm/[email protected]
- uses: helm/[email protected]
with:
node_image: kindest/node:v1.29.0
node_image: kindest/node:v1.30.2
- run: ct install --target-branch ${{ github.event.repository.default_branch }}

release:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-metrics-scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
type=raw,value=latest
type=match,pattern=\d+\.\d+\.\d+
type=sha
- uses: docker/setup-qemu-action@v3.1.0
- uses: docker/setup-buildx-action@v3.4.0
- uses: docker/setup-qemu-action@v3.2.0
- uses: docker/setup-buildx-action@v3.8.0
with:
config: .github/buildkitd.toml
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_RELEASE_USER }}
password: ${{ secrets.DOCKER_RELEASE_PASS }}
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
type=raw,value=latest
type=match,pattern=\d+\.\d+\.\d+
type=sha
- uses: docker/setup-qemu-action@v3.1.0
- uses: docker/setup-buildx-action@v3.4.0
- uses: docker/setup-qemu-action@v3.2.0
- uses: docker/setup-buildx-action@v3.8.0
with:
config: .github/buildkitd.toml
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_RELEASE_USER }}
password: ${{ secrets.DOCKER_RELEASE_PASS }}
- uses: docker/login-action@v3.2.0
- uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
25 changes: 16 additions & 9 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.29.0
- if: steps.list-changed.outputs.changed == 'true'
node_image: kindest/node:v1.30.2
- name: Install Chart
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
71 changes: 64 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5.0.1
- uses: actions/setup-go@v5.2.0
with:
go-version-file: modules/api/go.mod
check-latest: true
Expand All @@ -81,7 +81,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5.0.1
- uses: actions/setup-go@v5.2.0
with:
go-version-file: modules/api/go.mod
check-latest: true
Expand All @@ -99,7 +99,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5.0.1
- uses: actions/setup-go@v5.2.0
with:
go-version-file: modules/api/go.mod
check-latest: true
Expand All @@ -116,14 +116,71 @@ jobs:
fetch-depth: 0
- run: make image

publish:
name: Build and push API container
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' # not a fork and not dependabot
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
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5.0.1
- uses: actions/setup-go@v5.2.0
with:
go-version-file: modules/go.work
check-latest: true
Expand All @@ -133,7 +190,7 @@ jobs:
- working-directory: modules/web
run: yarn
- run: PATH=$PATH:$GOPATH/bin make coverage
- uses: codecov/codecov-action@v4.5.0
- uses: codecov/codecov-action@v5.1.1
with:
directory: ./.tmp
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -148,8 +205,8 @@ jobs:
# fetch-depth: 0
# - uses: helm/[email protected]
# with:
# node_image: kindest/node:v1.29.2
# - uses: actions/setup-go@v5.0.1
# node_image: kindest/node:v1.30.2
# - uses: actions/setup-go@v5.2.0
# with:
# go-version-file: modules/api/go.mod
# check-latest: true
Expand Down
17 changes: 14 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@
# limitations under the License.
#
run:
modules-download-mode: readonly
allow-parallel-runners: true
timeout: 30m
issues-exit-code: 1
tests: true
linters:
disable-all: true
enable:
- gocyclo
- goimports
# default linters
- errcheck
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- typecheck
- unused
- gocyclo

# additional linters
- errorlint
- errname
- goimports
- misspell
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ serve: $(PRE) --ensure-kind-cluster --ensure-metrics-server ## Starts developmen
SIDECAR_HOST=$(SIDECAR_HOST) \
docker compose -f $(DOCKER_COMPOSE_DEV_PATH) --project-name=$(PROJECT_NAME) up \
--build \
--force-recreate \
--remove-orphans \
--no-attach gateway \
--no-attach scraper \
Expand All @@ -90,7 +91,7 @@ serve: $(PRE) --ensure-kind-cluster --ensure-metrics-server ## Starts developmen
# Starts production version of the application.
#
# HTTPS: https://localhost:8443
# HTTP: https://localhost:8080
# HTTP: http://localhost:8080
#
# Note: Make sure that the ports 8443 (Gateway HTTPS) and 8080 (Gateway HTTP) are free on your localhost
.PHONY: run
Expand Down
2 changes: 1 addition & 1 deletion charts/kubernetes-dashboard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

apiVersion: v2
name: kubernetes-dashboard
version: 7.5.0
version: 7.10.0
description: General-purpose web UI for Kubernetes clusters
keywords:
- kubernetes
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
12 changes: 12 additions & 0 deletions charts/kubernetes-dashboard/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ helm.sh/chart: {{ include "kubernetes-dashboard.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "kubernetes-dashboard.name" . }}
{{- with .Values.app.labels }}
{{ toYaml . }}
{{- end }}
{{- end -}}

{{/*
Expand All @@ -63,6 +66,15 @@ app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: {{ include "kubernetes-dashboard.name" . }}
{{- end -}}

{{/*
Common annotations
*/}}
{{- define "kubernetes-dashboard.annotations" -}}
{{- with .Values.app.annotations }}
{{- toYaml . }}
{{- end }}
{{- end -}}

{{- define "kubernetes-dashboard.app.csrf.secret.name" -}}
{{- printf "%s-%s" ( include "kubernetes-dashboard.fullname" . ) "csrf"}}
{{- end -}}
Expand Down
27 changes: 0 additions & 27 deletions charts/kubernetes-dashboard/templates/_tplvalues.tpl

This file was deleted.

4 changes: 3 additions & 1 deletion charts/kubernetes-dashboard/templates/config/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if eq .Values.app.mode "dashboard" }}
{{- if and (eq .Values.app.mode "dashboard") (.Values.kong.enabled) }}

apiVersion: v1
kind: ConfigMap
metadata:
labels:
{{- include "kubernetes-dashboard.labels" . | nindent 4 }}
annotations:
{{- include "kubernetes-dashboard.annotations" . | nindent 4 }}
name: {{ .Values.kong.dblessConfig.configMap }}
data:
kong.yml: |
Expand Down
Loading

0 comments on commit 02dd071

Please sign in to comment.