diff --git a/Makefile b/Makefile index 23d96ac..b471b65 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ ARCH ?= $(shell go env GOARCH) OS ?= $(shell uname -s | tr A-Z a-z) K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME) -TAG ?= main +TAG ?= v0.6.0 .PHONY: all all: build diff --git a/charts/k8s-cleaner/Chart.yaml b/charts/k8s-cleaner/Chart.yaml index 41f32b2..3293913 100644 --- a/charts/k8s-cleaner/Chart.yaml +++ b/charts/k8s-cleaner/Chart.yaml @@ -3,9 +3,9 @@ name: k8s-cleaner description: "Cleaner identifies, removes, or updates stale/orphaned or unhealthy resources to maintain a clean and efficient Kubernetes cluster" type: application # Note: The version is overwritten by the release workflow. -version: 1.5.0 +version: 1.6.0 # Note: The version is overwritten by the release workflow. -appVersion: 0.5.0 +appVersion: 0.6.0 home: https://github.com/gianlucam76/k8s-cleaner icon: https://raw.githubusercontent.com/gianlucam76/k8s-cleaner/main/assets/logo.png keywords: diff --git a/charts/k8s-cleaner/README.md b/charts/k8s-cleaner/README.md index 9d5a8f9..45ef4c9 100644 --- a/charts/k8s-cleaner/README.md +++ b/charts/k8s-cleaner/README.md @@ -32,9 +32,15 @@ Major Changes to functions are documented with the version affected. **Before up | controller.image.pullPolicy | string | `"IfNotPresent"` | Controller Image pull policy | | controller.image.registry | string | `"docker.io"` | Controller Image Registry | | controller.image.repository | string | `"projectsveltos/k8s-cleaner"` | Controller Image Repository | -| controller.image.tag | string | `"v0.5.0"` | ControllerImage Tag | -| controller.livenessProbe | object | `{"enabled":true,"httpGet":{"path":"/healthz","port":8081},"initialDelaySeconds":15,"periodSeconds":20}` | Controller LivenessProbe | -| controller.readinessProbe | object | `{"enabled":true,"httpGet":{"path":"/readyz","port":8081},"initialDelaySeconds":5,"periodSeconds":10}` | Controller ReadinessProbe | +| controller.image.tag | string | `"v0.6.0"` | ControllerImage Tag | +| controller.livenessProbe | object | `{"enabled":true,"httpGet":{"path":"/healthz","port":"healthz","scheme":"HTTP"},"initialDelaySeconds":15,"periodSeconds":20}` | Controller LivenessProbe | +| controller.ports[0].containerPort | int | `8443` | | +| controller.ports[0].name | string | `"metrics"` | | +| controller.ports[0].protocol | string | `"TCP"` | | +| controller.ports[1].containerPort | int | `9440` | | +| controller.ports[1].name | string | `"healthz"` | | +| controller.ports[1].protocol | string | `"TCP"` | | +| controller.readinessProbe | object | `{"enabled":true,"httpGet":{"path":"/readyz","port":"healthz","scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":10}` | Controller ReadinessProbe | | controller.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"enabled":true,"runAsNonRoot":true}` | Controller SecurityCOntext | | controller.volumeMounts | list | `[]` | Controller VolumeMounts | | crds.install | bool | `true` | Install the CustomResourceDefinitions (This also manages the lifecycle of the CRDs for update operations) | diff --git a/charts/k8s-cleaner/templates/deployment.yaml b/charts/k8s-cleaner/templates/deployment.yaml index eee350d..182ea55 100644 --- a/charts/k8s-cleaner/templates/deployment.yaml +++ b/charts/k8s-cleaner/templates/deployment.yaml @@ -41,8 +41,7 @@ spec: image: "{{ .Values.controller.image.registry | trimSuffix "/" }}/{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.controller.image.pullPolicy }} args: - - --health-probe-bind-address=:8081 - - --metrics-bind-address=127.0.0.1:8080 + - --diagnostics-address=:8443 {{- range $key, $value := .Values.controller.args }} {{- if not (kindIs "invalid" $value) }} - -{{ $key | mustRegexFind "^[^_]+" }}={{ include "k8s-cleaner.template" (dict "tpl" $value "ctx" $.ctx) }} @@ -58,8 +57,11 @@ spec: command: - /manager ports: - - name: metrics - containerPort: 8080 + - containerPort: 8443 + name: metrics + protocol: TCP + - containerPort: 9440 + name: healthz protocol: TCP {{- if .Values.controller.livenessProbe.enabled }} livenessProbe: diff --git a/charts/k8s-cleaner/values.yaml b/charts/k8s-cleaner/values.yaml index 4539410..b0ad02d 100644 --- a/charts/k8s-cleaner/values.yaml +++ b/charts/k8s-cleaner/values.yaml @@ -26,11 +26,18 @@ controller: # -- Controller Image Repository repository: projectsveltos/k8s-cleaner # -- ControllerImage Tag - tag: "v0.5.0" + tag: "v0.6.0" # -- Controller Image pull policy pullPolicy: IfNotPresent # -- Controller ARguments args: {} + ports: + - containerPort: 8443 + name: metrics + protocol: TCP + - containerPort: 9440 + name: healthz + protocol: TCP # -- Controller SecurityCOntext securityContext: enabled: true @@ -44,7 +51,8 @@ controller: enabled: true httpGet: path: /healthz - port: 8081 + port: healthz + scheme: HTTP initialDelaySeconds: 15 periodSeconds: 20 # -- Controller ReadinessProbe @@ -52,7 +60,8 @@ controller: enabled: true httpGet: path: /readyz - port: 8081 + port: healthz + scheme: HTTP initialDelaySeconds: 5 periodSeconds: 10 # -- Controller VolumeMounts diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index b89c2f2..fd2f167 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -30,6 +30,7 @@ patches: # Protect the /metrics endpoint by putting it behind auth. # If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line. +- path: manager_auth_proxy_patch.yaml - path: manager_image_patch.yaml - path: manager_pull_policy.yaml diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index f0e689b..87e7d59 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -11,7 +11,4 @@ spec: containers: - name: controller args: - - "--diagnostics-address=:8443" - - "--health-probe-bind-address=:8081" - - "--metrics-bind-address=127.0.0.1:8080" - + - "--diagnostics-address=:8443" \ No newline at end of file diff --git a/config/default/manager_image_patch.yaml b/config/default/manager_image_patch.yaml index 6812f2a..3dfba2d 100644 --- a/config/default/manager_image_patch.yaml +++ b/config/default/manager_image_patch.yaml @@ -8,5 +8,5 @@ spec: spec: containers: # Change the value of image field below to your controller image URL - - image: docker.io/projectsveltos/k8s-cleaner:main + - image: docker.io/projectsveltos/k8s-cleaner:v0.6.0 name: controller diff --git a/manifest/manifest.yaml b/manifest/manifest.yaml index 69e06c8..8da32cc 100644 --- a/manifest/manifest.yaml +++ b/manifest/manifest.yaml @@ -478,9 +478,11 @@ spec: control-plane: k8s-cleaner spec: containers: - - command: + - args: + - --diagnostics-address=:8443 + command: - /manager - image: docker.io/projectsveltos/k8s-cleaner:main + image: docker.io/projectsveltos/k8s-cleaner:v0.6.0 livenessProbe: failureThreshold: 3 httpGet: