feat(ql3): add opt-in security administration job

This commit is contained in:
whyour
2026-08-25 03:15:37 +08:00
parent fbedae0116
commit 931f9eee38
31 changed files with 1606 additions and 14 deletions
@@ -0,0 +1,31 @@
- op: replace
path: /spec/template/spec/containers/0/env
value:
- name: QL3_POSTGRES_ADMIN_TLS_MODE
value: verify-full
- name: QL3_POSTGRES_ADMIN_TLS_CA_FILE
value: /var/run/secrets/qinglong3/postgres-security-administration/ca.crt
- name: QL3_POSTGRES_ADMIN_HOST
value: ql3-postgres-rw.qinglong3-system.svc
- name: QL3_POSTGRES_ADMIN_PORT
value: '5432'
- name: QL3_POSTGRES_ADMIN_DATABASE
value: qinglong
- name: QL3_POSTGRES_ADMIN_USER
valueFrom:
secretKeyRef:
name: ql3-postgres-admin-auth
key: username
- name: QL3_POSTGRES_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: ql3-postgres-admin-auth
key: password
- name: QL3_POSTGRES_ADMIN_TLS_SERVERNAME
value: ql3-postgres-rw.qinglong3-system.svc
- op: replace
path: /spec/template/spec/volumes/2/secret/secretName
value: ql3-postgres-ca
- op: replace
path: /spec/template/spec/volumes/2/secret/items/0/key
value: ca.crt
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
patches:
- path: job-patch.yaml
target:
group: batch
version: v1
kind: Job
name: ql3-security-administration
- path: network-policy-patch.yaml
target:
group: networking.k8s.io
version: v1
kind: NetworkPolicy
name: ql3-security-administration
images:
- name: qinglong3-cluster-admin
newName: registry.example.com/qinglong/qinglong3-cluster-admin
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: ql3-security-administration
namespace: qinglong3-system
spec:
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
- to:
- podSelector:
matchLabels:
cnpg.io/cluster: ql3-postgres
ports:
- protocol: TCP
port: 5432