Skip to content
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

Add mechnism to create permissive peerauthenticaion for koperator's default alert manager #856

Merged
merged 3 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/kafka-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Parameter | Description | Default
`imagePullSecrets` | Image pull secrets can be set | `[]`
`replicaCount` | Operator replica count can be set | `1`
`alertManager.enable` | AlertManager can be enabled | `true`
`alertManager.permissivePeerAuthentication.create` | Permissive PeerAuthentication (Istio resource) for AlertManager can be created | `true`
`nodeSelector` | Operator pod node selector can be set | `{}`
`tolerations` | Operator pod tolerations can be set | `[]`
`affinity` | Operator pod affinity can be set | `{}`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if and (.Values.alertManager.enable) (.Values.alertManager.permissivePeerAuthentication.create) (.Capabilities.APIVersions.Has "security.istio.io/v1beta1") -}}
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: "{{ include "kafka-operator.fullname" . }}-alertmanager-peerauthenticaiton"
namespace: {{ .Release.Namespace | quote }}
labels:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
app.kubernetes.io/name: {{ include "kafka-operator.name" . }}
helm.sh/chart: {{ include "kafka-operator.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: alertmanager
spec:
selector:
matchLabels:
control-plane: controller-manager
component: alertmanager
portLevelMtls:
{{ .Values.alertManager.port | quote }}:
mode: PERMISSIVE
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ spec:
app.kubernetes.io/component: operator
ports:
- name: http-alerts
port: 9001
port: {{ .Values.alertManager.port }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ spec:
- containerPort: {{ (.Values.metricEndpoint).port | default 8080 }}
name: metrics
protocol: TCP
- containerPort: 9001
- containerPort: {{ .Values.alertManager.port }}
name: alerts
protocol: TCP
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions charts/kafka-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ certSigning:

alertManager:
enable: true
port: 9001
permissivePeerAuthentication:
create: false

prometheusMetrics:
enabled: true
Expand Down