-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: revert instrumentation when operator is uninstalled
- Loading branch information
Showing
21 changed files
with
883 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ rules: | |
verbs: | ||
- create | ||
- delete | ||
- deletecollection | ||
- get | ||
- list | ||
- patch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
helm-chart/dash0-operator/templates/operator/pre-delete-hook.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "dash0-operator.chartName" . }}-pre-delete | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/name: job | ||
app.kubernetes.io/instance: pre-delete-hook | ||
app.kubernetes.io/component: pre-delete | ||
{{- include "dash0-operator.labels" . | nindent 4 }} | ||
dash0.com/enable: "false" | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
metadata: | ||
name: {{ .Release.Name }}-pre-delete-job | ||
labels: | ||
app.kubernetes.io/instance: pre-delete-hook | ||
app.kubernetes.io/managed-by: {{ .Release.Service | quote }} | ||
helm.sh/chart: {{ include "dash0-operator.chartNameWithVersion" . }} | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: pre-delete-job | ||
image: {{ include "dash0-operator.image" . | quote }} | ||
imagePullPolicy: {{ .Values.operator.image.pullPolicy }} | ||
command: | ||
- /manager | ||
- "--uninstrument-all" | ||
{{ include "dash0-operator.restrictiveContainerSecurityContext" . | nindent 10 }} | ||
resources: | ||
{{- toYaml .Values.operator.managerPodResources | nindent 12 }} | ||
securityContext: | ||
runAsNonRoot: true | ||
serviceAccountName: {{ template "dash0-operator.serviceAccountName" . }} | ||
automountServiceAccountToken: true | ||
backoffLimit: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
helm-chart/dash0-operator/tests/operator/__snapshot__/pre-delete-hook_test.yaml.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
pre-delete hook job should match snapshot: | ||
1: | | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
annotations: | ||
helm.sh/hook: pre-delete | ||
helm.sh/hook-delete-policy: hook-succeeded | ||
labels: | ||
app.kubernetes.io/component: pre-delete | ||
app.kubernetes.io/instance: pre-delete-hook | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: job | ||
app.kubernetes.io/part-of: dash0-operator | ||
app.kubernetes.io/version: 1.0.0 | ||
dash0.com/enable: "false" | ||
helm.sh/chart: dash0-operator-1.0.0 | ||
name: dash0-operator-pre-delete | ||
namespace: NAMESPACE | ||
spec: | ||
backoffLimit: 2 | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: pre-delete-hook | ||
app.kubernetes.io/managed-by: Helm | ||
helm.sh/chart: dash0-operator-1.0.0 | ||
name: RELEASE-NAME-pre-delete-job | ||
spec: | ||
automountServiceAccountToken: true | ||
containers: | ||
- command: | ||
- /manager | ||
- --uninstrument-all | ||
image: dash0-operator-controller:1.0.0 | ||
imagePullPolicy: null | ||
name: pre-delete-job | ||
resources: | ||
limits: | ||
cpu: 500m | ||
ephemeral-storage: 500Mi | ||
memory: 128Mi | ||
requests: | ||
cpu: 10m | ||
ephemeral-storage: 500Mi | ||
memory: 64Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
restartPolicy: OnFailure | ||
securityContext: | ||
runAsNonRoot: true | ||
serviceAccountName: dash0-operator-controller-manager |
7 changes: 7 additions & 0 deletions
7
helm-chart/dash0-operator/tests/operator/pre-delete-hook_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
suite: test pre-delete hook job | ||
templates: | ||
- operator/pre-delete-hook.yaml | ||
tests: | ||
- it: pre-delete hook job should match snapshot | ||
asserts: | ||
- matchSnapshot: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.