[platform]: add migration for kube-rbac-proxy daemonset

Signed-off-by: kklinch0 <kklinch0@gmail.com>
This commit is contained in:
kklinch0
2025-04-22 13:05:45 +03:00
parent 5903bbc64a
commit fde6e9cc73
6 changed files with 101 additions and 0 deletions

View File

@@ -270,7 +270,10 @@ releases:
{{- end }}
{{- end }}
{{- end }}
frontend:
resourcesPreset: "none"
dashboard:
resourcesPreset: "none"
{{- $cozystackBranding:= lookup "v1" "ConfigMap" "cozy-system" "cozystack-branding" }}
{{- $branding := dig "data" "branding" "" $cozystackBranding }}
{{- if $branding }}

View File

@@ -168,7 +168,10 @@ releases:
{{- end }}
{{- end }}
{{- end }}
frontend:
resourcesPreset: "none"
dashboard:
resourcesPreset: "none"
{{- $cozystackBranding:= lookup "v1" "ConfigMap" "cozy-system" "cozystack-branding" }}
{{- $branding := dig "data" "branding" "" $cozystackBranding }}
{{- if $branding }}

View File

@@ -0,0 +1,80 @@
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: dashboard-internal-dashboard
namespace: cozy-dashboard
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: dashboard-internal-dashboard
updatePolicy:
updateMode: "Auto"
resourcePolicy:
containerPolicies:
- containerName: dashboard
controlledResources: ["cpu", "memory"]
minAllowed:
cpu: 50m
memory: 64Mi
maxAllowed:
cpu: 500m
memory: 512Mi
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: dashboard-internal-kubeappsapis
namespace: cozy-dashboard
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: dashboard-internal-kubeappsapis
updatePolicy:
updateMode: "Auto"
resourcePolicy:
containerPolicies:
- containerName: kubeappsapis
controlledResources: ["cpu", "memory"]
minAllowed:
cpu: 50m
memory: 100Mi
maxAllowed:
cpu: 1000m
memory: 1Gi
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: dashboard-vpa
namespace: cozy-dashboard
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: dashboard
updatePolicy:
updateMode: "Auto"
resourcePolicy:
containerPolicies:
- containerName: nginx
controlledResources: ["cpu", "memory"]
minAllowed:
cpu: "50m"
memory: "64Mi"
maxAllowed:
cpu: "500m"
memory: "512Mi"
{{- $dashboardKCconfig := lookup "v1" "ConfigMap" "cozy-dashboard" "kubeapps-auth-config" }}
{{- $dashboardKCValues := dig "data" "values.yaml" "" $dashboardKCconfig }}
{{- if $dashboardKCValues }}
- containerName: auth-proxy
controlledResources: ["cpu", "memory"]
minAllowed:
cpu: "50m"
memory: "64Mi"
maxAllowed:
cpu: "500m"
memory: "512Mi"
{{- end }}

View File

@@ -15,12 +15,14 @@ kubeapps:
flux:
enabled: true
dashboard:
resourcesPreset: "none"
image:
registry: ghcr.io/cozystack/cozystack
repository: dashboard
tag: v0.30.2
digest: "sha256:a83fe4654f547469cfa469a02bda1273c54bca103a41eb007fdb2e18a7a91e93"
kubeappsapis:
resourcesPreset: "none"
image:
registry: ghcr.io/cozystack/cozystack
repository: kubeapps-apis

View File

@@ -216,6 +216,7 @@ data:
values.yaml: |
kubeapps:
authProxy:
resourcesPreset: "none"
enabled: true
provider: "oidc"
clientID: "kubeapps"

12
scripts/migrations/10 Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Migration 10 --> 11
# Force reconcile hr keycloak-configure
if kubectl get helmrelease keycloak-configure -n cozy-keycloak; then
kubectl delete po -l app=source-controller -n cozy-fluxcd
timestamp=$(date --rfc-3339=ns)
kubectl annotate helmrelease keycloak-configure -n cozy-keycloak \
reconcile.fluxcd.io/forceAt="$timestamp" \
reconcile.fluxcd.io/requestedAt="$timestamp" \
--overwrite
fi