-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(k8s): package the operator as a helm chart #343
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
Changes from all commits
c7587df
97b94e0
4962ad2
68267a1
99657f6
6910839
88c1e47
999086c
8639a62
a2b0634
f7743ee
523777a
3539e24
c1687de
e7c4082
077c02d
523696f
a6f3e6a
2949354
ce37ab5
c11861b
a00d8cd
fdd0518
230b67e
9ba6f60
a57b062
f21ca21
994d550
deb1a25
12fa8fa
de53f2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v2 | ||
| name: streaming-operator | ||
| type: application | ||
| kubeVersion: ">=1.23.0-0" | ||
| version: 0.0.0 | ||
| appVersion: "latest" | ||
| sources: | ||
| - https://github.com/getsentry/streams/tree/main/sentry_streams_k8s |
|
bmcquilkin-sentry marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {{- define "streaming-operator.name" -}} | ||
| {{- .Chart.Name | trunc 63 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "streaming-operator.fullname" -}} | ||
| {{- include "streaming-operator.name" . -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "streaming-operator.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "streaming-operator.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end -}} | ||
|
|
||
| {{- define "streaming-operator.labels" -}} | ||
| {{ include "streaming-operator.selectorLabels" . }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }} | ||
| {{- with .Values.labels }} | ||
| {{ toYaml . }} | ||
|
bmcquilkin-sentry marked this conversation as resolved.
|
||
| {{- end }} | ||
| {{- end -}} | ||
|
|
||
| {{- define "streaming-operator.serviceAccountName" -}} | ||
| {{- default (include "streaming-operator.fullname" .) .Values.serviceAccount.name -}} | ||
| {{- end -}} | ||
|
|
||
| {{- define "streaming-operator.workloadNamespace" -}} | ||
| {{- required "workloadNamespace must be set" .Values.workloadNamespace -}} | ||
| {{- end -}} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
|
fpacifici marked this conversation as resolved.
|
||
| {{- include "streaming-operator.labels" . | nindent 4 }} | ||
| spec: | ||
| replicas: 1 | ||
| strategy: | ||
| type: Recreate | ||
| selector: | ||
| matchLabels: | ||
| {{- include "streaming-operator.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 8 }} | ||
| {{- with .Values.podLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.podAnnotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| serviceAccountName: {{ include "streaming-operator.serviceAccountName" . }} | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1000 | ||
| runAsGroup: 1000 | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - name: operator | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| env: | ||
| - name: WORKLOAD_NAMESPACE | ||
| value: {{ include "streaming-operator.workloadNamespace" . | quote }} | ||
| {{- with .Values.env }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: [ALL] | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.priorityClassName }} | ||
| priorityClassName: {{ . }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: {{ include "streaming-operator.workloadNamespace" . }} | ||
| annotations: | ||
| helm.sh/resource-policy: keep | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} |
|
bmcquilkin-sentry marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: [apiextensions.k8s.io] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please scope all of these to the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -1. Should be scoped within the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gi0baro this is not going to be deployed in the same namespace as the consumers it manages. The operator is likely going to run into sentry-system, right ? Or is the recommendation different ? |
||
| resources: [customresourcedefinitions] | ||
| verbs: [list, watch] | ||
| - apiGroups: [""] | ||
| resources: [namespaces] | ||
| verbs: [list, watch] | ||
| - apiGroups: [streams.sentry.io] | ||
| resources: [streamingpipelines] | ||
| verbs: [list, watch, patch] | ||
| - apiGroups: [streams.sentry.io] | ||
| resources: [streamingpipelines/status] | ||
| verbs: [patch] | ||
|
bmcquilkin-sentry marked this conversation as resolved.
|
||
| - apiGroups: [""] | ||
| resources: [events] | ||
| verbs: [create] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "streaming-operator.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| namespace: {{ include "streaming-operator.workloadNamespace" . }} | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: [configmaps] | ||
| verbs: [get, list, create, patch, delete] | ||
| - apiGroups: [apps] | ||
| resources: [deployments] | ||
| verbs: [get, list, create, patch, delete] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| namespace: {{ include "streaming-operator.workloadNamespace" . }} | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: {{ include "streaming-operator.fullname" . }} | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "streaming-operator.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: {{ include "streaming-operator.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "streaming-operator.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # - labels is for things like Sentry COGS tags (service, app_feature, component). | ||
| # - serviceAccount.name defaults to the chart's full name when left empty. | ||
| # - image.tag defaults to the chart's appVersion when left empty. | ||
|
|
||
| workloadNamespace: "" | ||
|
|
||
| image: | ||
| repository: us-central1-docker.pkg.dev/sentryio/streaming-operator/image | ||
| tag: "" | ||
| pullPolicy: IfNotPresent | ||
|
|
||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 256Mi | ||
| limits: | ||
| memory: 256Mi | ||
|
|
||
| env: [] | ||
|
|
||
| labels: {} | ||
|
|
||
| podLabels: {} | ||
| podAnnotations: {} | ||
|
|
||
| serviceAccount: | ||
| name: "" | ||
|
|
||
| nodeSelector: {} | ||
| tolerations: [] | ||
| affinity: {} | ||
| priorityClassName: "" |
Uh oh!
There was an error while loading. Please reload this page.