Skip to content

Commit 475e2d2

Browse files
chore(pmm): support networkpolicy (#40)
* chore(mysql-cluster): modify networkpolicy * fix(prometheus): fix typo * chore(prometheus): add plans 50 * chore(mysql-cluster): add networkpolicy * chore(prometheus): add networkpolicy * chore(promtheus): service discovery in namespace * chore(mysql-cluster): plans 10 * chore(mysql-cluster): add max_connection_limit * chore(mysql-cluster): add plans * chore(prometheus): support discovery addons in namespaces * fix(prometheus): is enabled scrape addons metrics * feat(drycc-addons): add postgresql-cluster * chore(postgresql-cluster): move patroni env to helper * chore(postgresql-cluster):adjust patroni config use configmap * chore(postgresql-cluster):organize code structure * chore(postgresql-cluster): add metrics * chore(postgresql-cluster): add metrics * chore(postgresql-cluster): rename postgresql to postgresql-cluster * chore(postgresql-cluster) add wal-g for backup * chore(postgresql-cluster): redirect postgresql log * chore(postgresql-cluster): add pgbackup * chore(postgresql-cluster): add plans * chore(addons): add cloudbeaver * chore(addons): fix plan binds * chore(prometheus): add auth * fix(postgresql-cluster): service type nil * fix(cloudbeaver): labels application * fix(postgresql-cluster): plans describe typo * chore(postgresql-cluster): allow dyrcc params * chore(postgresql-cluster): generate password random * chore(postgresql-cluster): Adjust backup strategy * chore(postgresql-cluster): bind info * chore(postgresql-cluster): fix typo * chore(postgresql-cluster): megre * chore(postgresql-cluster): megre * chore(cloudbeaver): modify storage method * chore(postgresql-cluster): adjust * chore(postgresql-cluster): fix password & netpolicy * chore(addons): add persistentVolumeClaimRetentionPolicy * chore(addons): update support * megre(addons): megre from upstream * chore(postgresql-cluster): reset wal retain size * chore(postgresql-cluster):add hugepages-2Mi limit in plans * chore(addons): alter cloudbeaver plan to 10, prometheus add hotupdate param * chore(mysql-cluster): adjust bind params * chore(postgresql-cluster): add plan 4t * chore(postgresql-cluster): adjust pg params & monitor user privilege * chore(mysql-cluster): set persistentVolumeClaimRetentionPolicy deleted * chore(mysql-cluster): persistence group_replication_group_name after greate new cluster * chore(mysql-cluster): delete charts common * chore(postgresql-cluster): reset max_slot_wal_keep_size * chore(mysql): Re-implementing the cluster implementation * chore(postgresql-cluster): fix 4t plan * chore(addons): add pmm * chore(pmm): set instance name * chore(prometheus): add scrape namespace * chore(postgres): set service type to ClusterIP * chore(postgres): update metrics default values * chore(mysql-cluster): add router configmap , add resources limits to router and metrics * chore(mysql-cluster): modify networkpolicy rules. empty ingress when router service type is loadbalancer * chore(postgresql-cluster): Allow all ip when service type is Loadbalancer * chore(cloudbeaver): add networkpolicy ,Allow all ip when service type is Loadbalancer * chore(cloudbeaver): fix typo * chore(pmm): pmm network support * chore(pmm): fix pmm chart.yaml --------- Co-authored-by: lijianguo <lijianguo1991@outlook.com>
1 parent 718d5d8 commit 475e2d2

4 files changed

Lines changed: 92 additions & 18 deletions

File tree

addons/cloudbeaver/23/chart/cloudbeaver/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ ingress:
516516
extraRules: []
517517
## @section Network Policy
518518

519-
## MySQL Nework Policy configuration
520-
##
519+
## Nework Policy configuration
520+
521521
networkPolicy:
522522
## @param networkPolicy.enabled Enable creation of NetworkPolicy resources
523523
##
Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
annotations:
2+
category: monitor
13
apiVersion: v2
2-
name: pmm
3-
description: A Helm chart for Percona Monitoring and Management (PMM)
4-
type: application
5-
version: 1.3.11
6-
appVersion: "2.41.1"
7-
home: https://github.com/percona/pmm
8-
maintainers:
9-
- name: tplavcic
10-
email: tomislav.plavcic@percona.com
11-
- name: bupychuk
12-
email: nurlan.moldomurov@percona.com
13-
- name: spron-in
14-
email: sergey.pronin@percona.com
4+
appVersion: 2.41
5+
dependencies:
6+
- name: common
7+
repository: oci://registry.drycc.cc/charts
8+
tags:
9+
- drycc-common
10+
version: ~1.1.2
11+
description: Percona Monitoring and Management an open source database monitoring, observability and management tool
12+
engine: gotpl
13+
home: https://github.com/drycc/charts/tree/master/drycc/pmm
14+
icon: https://drycc.com/assets/stacks/pmm/img/pmm-stack-220x234.png
1515
keywords:
16-
- PMM
17-
- Monitoring
18-
icon: https://www.percona.com/sites/default/files/pmm-logo.png
16+
- mysql
17+
- postgres
18+
- mongodb
19+
- monitor
20+
maintainers:
21+
- name: Drycc
22+
url: https://github.com/drycc/charts
23+
name: pmm
24+
sources:
25+
- https://github.com/drycc/containers/tree/main/drycc/mysql
26+
- https://github.com/percona/pmm
27+
version: 2.41
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{- /*
2+
Copyright Drycc Community.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.networkPolicy.enabled }}
7+
kind: NetworkPolicy
8+
apiVersion: {{ template "common.capabilities.networkPolicy.apiVersion" . }}
9+
metadata:
10+
name: {{ template "common.names.fullname" . }}
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{- include "common.labels.standard" . | nindent 4 }}
13+
{{- if .Values.commonLabels }}
14+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15+
{{- end }}
16+
{{- if .Values.commonAnnotations }}
17+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
18+
{{- end }}
19+
spec:
20+
podSelector:
21+
matchLabels:
22+
{{- include "common.labels.matchLabels" . | nindent 6 }}
23+
{{- if eq .Values.service.type "ClusterIP" }}
24+
ingress:
25+
# Allow inbound connections
26+
{{- with .Values.service.ports }}
27+
- ports:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
{{- if or .Values.networkPolicy.allowCurrentNamespace .Values.networkPolicy.allowNamespaces }}
31+
from:
32+
{{- if .Values.networkPolicy.allowCurrentNamespace }}
33+
- namespaceSelector:
34+
matchLabels:
35+
kubernetes.io/metadata.name: {{ .Release.Namespace }}
36+
{{- end }}
37+
{{- range $namespace := .Values.networkPolicy.allowNamespaces }}
38+
{{- if $namespace }}
39+
- namespaceSelector:
40+
matchLabels:
41+
kubernetes.io/metadata.name: {{ $namespace }}
42+
{{- end }}
43+
{{- end }}
44+
{{- end }}
45+
{{- end }}
46+
{{- if eq .Values.service.type "LoadBalancer" }}
47+
ingress:
48+
- {}
49+
{{- end}}
50+
{{- end }}

addons/pmm/2.41/chart/pmm/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,18 @@ extraVolumeMounts: []
226226
## @param extraVolumes Optionally specify extra list of additional volumes
227227
##
228228
extraVolumes: []
229+
230+
## Nework Policy configuration
231+
##
232+
networkPolicy:
233+
## @param networkPolicy.enabled Enable creation of NetworkPolicy resources
234+
##
235+
enabled: true
236+
## @param networkPolicy.allowExternal The Policy model to apply.
237+
## When set to false, only pods with the correct
238+
## client label will have network access to the port MySQL is listening
239+
## on. When true, MySQL will accept connections from any source
240+
## (with the correct destination port).
241+
##
242+
allowCurrentNamespace: true
243+
allowNamespaces: []

0 commit comments

Comments
 (0)