mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 10:32:40 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: ql3-plugin-package-executor
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-executor
|
||||
app.kubernetes.io/component: plugin-package-executor
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
spec:
|
||||
schedule: '*/2 * * * *'
|
||||
concurrencyPolicy: Forbid
|
||||
startingDeadlineSeconds: 60
|
||||
successfulJobsHistoryLimit: 1
|
||||
failedJobsHistoryLimit: 3
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 2
|
||||
activeDeadlineSeconds: 600
|
||||
ttlSecondsAfterFinished: 600
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-executor
|
||||
app.kubernetes.io/component: plugin-package-executor
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
spec:
|
||||
serviceAccountName: ql3-plugin-package-executor
|
||||
automountServiceAccountToken: false
|
||||
restartPolicy: Never
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 10001
|
||||
runAsGroup: 10001
|
||||
fsGroup: 10001
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: executor
|
||||
image: qinglong3-cluster-admin:3.0.0-alpha.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- node
|
||||
- /opt/qinglong/node_modules/@qinglong/cluster-admin/dist/plugin-package/executor/pluginPackageExecutorCli.js
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_ENABLED
|
||||
value: 'true'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_OWNER
|
||||
value: cluster_package_executor
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_APPROVAL_BATCH_SIZE
|
||||
value: '8'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_DISPATCH_BATCH_SIZE
|
||||
value: '8'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_MAX_BATCHES
|
||||
value: '4'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_LEASE_DURATION_MS
|
||||
value: '600000'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_REVOCATION_PAGE_SIZE
|
||||
value: '16'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_REVOCATION_MAX_PAGES
|
||||
value: '16'
|
||||
- name: QL3_POSTGRES_TLS_MODE
|
||||
value: verify-full
|
||||
- name: QL3_POSTGRES_TLS_CA_FILE
|
||||
value: /var/run/secrets/qinglong3/postgres-package-executor/ca.crt
|
||||
- name: QL3_POSTGRES_APPLICATION_NAME
|
||||
value: qinglong3-plugin-package-executor
|
||||
- name: QL3_POSTGRES_MAX_CONNECTIONS
|
||||
value: '2'
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-cluster-plugin-package-executor
|
||||
key: postgres-package-executor-url
|
||||
- name: QL3_POSTGRES_TLS_SERVERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-cluster-plugin-package-executor
|
||||
key: postgres-tls-servername
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 256Mi
|
||||
volumeMounts:
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
- name: postgres-package-executor-ca
|
||||
mountPath: /var/run/secrets/qinglong3/postgres-package-executor
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: tmp
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
sizeLimit: 8Mi
|
||||
- name: postgres-package-executor-ca
|
||||
secret:
|
||||
secretName: ql3-cluster-plugin-package-executor
|
||||
defaultMode: 292
|
||||
items:
|
||||
- key: postgres-ca.crt
|
||||
path: ca.crt
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- service-account.yaml
|
||||
- cron-job.yaml
|
||||
- network-policy.yaml
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: ql3-plugin-package-executor
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-executor
|
||||
app.kubernetes.io/component: plugin-package-executor
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-executor
|
||||
app.kubernetes.io/component: plugin-package-executor
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress: []
|
||||
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
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: ql3-plugin-package-executor
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-executor
|
||||
app.kubernetes.io/component: plugin-package-executor
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
automountServiceAccountToken: false
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
- op: replace
|
||||
path: /spec/jobTemplate/spec/template/spec/containers/0/env
|
||||
value:
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_ENABLED
|
||||
value: 'true'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_OWNER
|
||||
value: cluster_package_executor
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_APPROVAL_BATCH_SIZE
|
||||
value: '8'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_DISPATCH_BATCH_SIZE
|
||||
value: '8'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_MAX_BATCHES
|
||||
value: '4'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_LEASE_DURATION_MS
|
||||
value: '600000'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_REVOCATION_PAGE_SIZE
|
||||
value: '16'
|
||||
- name: QL3_PLUGIN_PACKAGE_EXECUTOR_REVOCATION_MAX_PAGES
|
||||
value: '16'
|
||||
- name: QL3_POSTGRES_TLS_MODE
|
||||
value: verify-full
|
||||
- name: QL3_POSTGRES_TLS_CA_FILE
|
||||
value: /var/run/secrets/qinglong3/postgres-package-executor/ca.crt
|
||||
- name: QL3_POSTGRES_APPLICATION_NAME
|
||||
value: qinglong3-plugin-package-executor
|
||||
- name: QL3_POSTGRES_MAX_CONNECTIONS
|
||||
value: '2'
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_HOST
|
||||
value: ql3-postgres-rw.qinglong3-system.svc
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_PORT
|
||||
value: '5432'
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_DATABASE
|
||||
value: qinglong
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-postgres-package-executor-auth
|
||||
key: username
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-postgres-package-executor-auth
|
||||
key: password
|
||||
- name: QL3_POSTGRES_TLS_SERVERNAME
|
||||
value: ql3-postgres-rw.qinglong3-system.svc
|
||||
- op: replace
|
||||
path: /spec/jobTemplate/spec/template/spec/volumes/1/secret/secretName
|
||||
value: ql3-postgres-ca
|
||||
- op: replace
|
||||
path: /spec/jobTemplate/spec/template/spec/volumes/1/secret/items/0/key
|
||||
value: ca.crt
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../base
|
||||
|
||||
patches:
|
||||
- target:
|
||||
group: batch
|
||||
version: v1
|
||||
kind: CronJob
|
||||
labelSelector: app.kubernetes.io/name=ql3-plugin-package-executor
|
||||
path: cron-job-patch.yaml
|
||||
- target:
|
||||
group: networking.k8s.io
|
||||
version: v1
|
||||
kind: NetworkPolicy
|
||||
name: ql3-plugin-package-executor
|
||||
path: network-policy-patch.yaml
|
||||
|
||||
images:
|
||||
- name: qinglong3-cluster-admin
|
||||
newName: registry.example.com/qinglong/qinglong3-cluster-admin
|
||||
# Fail closed until the independently verified release digest is supplied.
|
||||
digest: sha256:0000000000000000000000000000000000000000000000000000000000000000
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
- op: add
|
||||
path: /spec/egress/-
|
||||
value:
|
||||
to:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: ql3-postgres
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
@@ -0,0 +1,12 @@
|
||||
# Example only. Copy into a private overlay and replace every placeholder.
|
||||
# The executor must receive only the package-executor database credential.
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: ql3-cluster-plugin-package-executor
|
||||
namespace: qinglong3-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
postgres-package-executor-url: REPLACE_WITH_PACKAGE_EXECUTOR_DSN
|
||||
postgres-tls-servername: REPLACE_WITH_POSTGRES_DNS_NAME
|
||||
postgres-ca.crt: REPLACE_WITH_POSTGRES_CA_CERTIFICATE
|
||||
Reference in New Issue
Block a user