mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-23 12:05:27 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- rbac.yaml
|
||||
- recover-job.yaml
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-recovery
|
||||
app.kubernetes.io/component: plugin-package-recovery
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
automountServiceAccountToken: false
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-recovery
|
||||
app.kubernetes.io/component: plugin-package-recovery
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ''
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-recovery
|
||||
app.kubernetes.io/component: plugin-package-recovery
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: ql3-plugin-package-recovery
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-recovery
|
||||
app.kubernetes.io/component: plugin-package-recovery
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
activeDeadlineSeconds: 600
|
||||
ttlSecondsAfterFinished: 600
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: ql3-plugin-package-recovery
|
||||
app.kubernetes.io/component: plugin-package-recovery
|
||||
app.kubernetes.io/part-of: qinglong3
|
||||
spec:
|
||||
serviceAccountName: ql3-plugin-package-recovery
|
||||
automountServiceAccountToken: true
|
||||
restartPolicy: Never
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 10001
|
||||
runAsGroup: 10001
|
||||
fsGroup: 10001
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: recovery
|
||||
image: qinglong3-cluster-admin:3.0.0-alpha.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- node
|
||||
- /opt/qinglong/node_modules/@qinglong/cluster-admin/dist/plugin-package/recovery/pluginPackageRecoveryCli.js
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
- name: QL3_CLUSTER_IDENTITY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: ql3-plugin-package-recovery-config
|
||||
key: cluster-identity
|
||||
- name: QL3_KUBERNETES_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: QL3_PLUGIN_PACKAGE_OCI_REGISTRIES
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: ql3-plugin-package-recovery-config
|
||||
key: oci-registries
|
||||
- name: QL3_PLUGIN_PACKAGE_PUBLISHER_TRUST_FILE
|
||||
value: /var/run/qinglong3/plugin-package-trust/publishers.json
|
||||
- name: QL3_PLUGIN_PACKAGE_TRUST_AUTHORITY_ID
|
||||
value: cluster
|
||||
- name: QL3_PLUGIN_PACKAGE_OCI_TIMEOUT_MS
|
||||
value: '15000'
|
||||
- name: QL3_PLUGIN_PACKAGE_RECOVERY_PAGE_SIZE
|
||||
value: '16'
|
||||
- name: QL3_PLUGIN_PACKAGE_RECOVERY_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-recovery
|
||||
- name: QL3_POSTGRES_PACKAGE_EXECUTOR_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-cluster-plugin-package-recovery
|
||||
key: postgres-package-executor-url
|
||||
- name: QL3_POSTGRES_TLS_SERVERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: ql3-cluster-plugin-package-recovery
|
||||
key: postgres-tls-servername
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: '1'
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
- name: plugin-package-trust
|
||||
mountPath: /var/run/qinglong3/plugin-package-trust
|
||||
readOnly: true
|
||||
- name: postgres-package-executor-ca
|
||||
mountPath: /var/run/secrets/qinglong3/postgres-package-executor
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: tmp
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
sizeLimit: 16Mi
|
||||
- name: plugin-package-trust
|
||||
configMap:
|
||||
name: ql3-plugin-publisher-trust
|
||||
defaultMode: 292
|
||||
items:
|
||||
- key: publishers.json
|
||||
path: publishers.json
|
||||
- name: postgres-package-executor-ca
|
||||
secret:
|
||||
secretName: ql3-cluster-plugin-package-recovery
|
||||
defaultMode: 292
|
||||
items:
|
||||
- key: postgres-ca.crt
|
||||
path: ca.crt
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../base
|
||||
|
||||
patches:
|
||||
- target:
|
||||
group: batch
|
||||
version: v1
|
||||
kind: Job
|
||||
labelSelector: app.kubernetes.io/name=ql3-plugin-package-recovery
|
||||
path: recover-job-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
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
- op: replace
|
||||
path: /spec/template/spec/containers/0/env
|
||||
value:
|
||||
- name: QL3_CLUSTER_IDENTITY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: ql3-plugin-package-recovery-config
|
||||
key: cluster-identity
|
||||
- name: QL3_KUBERNETES_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: QL3_PLUGIN_PACKAGE_OCI_REGISTRIES
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: ql3-plugin-package-recovery-config
|
||||
key: oci-registries
|
||||
- name: QL3_PLUGIN_PACKAGE_PUBLISHER_TRUST_FILE
|
||||
value: /var/run/qinglong3/plugin-package-trust/publishers.json
|
||||
- name: QL3_PLUGIN_PACKAGE_TRUST_AUTHORITY_ID
|
||||
value: cluster
|
||||
- name: QL3_PLUGIN_PACKAGE_OCI_TIMEOUT_MS
|
||||
value: '15000'
|
||||
- name: QL3_PLUGIN_PACKAGE_RECOVERY_PAGE_SIZE
|
||||
value: '16'
|
||||
- name: QL3_PLUGIN_PACKAGE_RECOVERY_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-recovery
|
||||
- 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/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,31 @@
|
||||
# Example only. Copy into a private deployment overlay and replace all values.
|
||||
# Publisher public keys are not credentials, but they are release authority and
|
||||
# must be reviewed independently from the package registry.
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery-config
|
||||
namespace: qinglong3-system
|
||||
data:
|
||||
cluster-identity: REPLACE_WITH_STABLE_CLUSTER_IDENTITY
|
||||
oci-registries: ghcr.io
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ql3-plugin-publisher-trust
|
||||
namespace: qinglong3-system
|
||||
data:
|
||||
publishers.json: |
|
||||
{
|
||||
"schema": "qinglong/plugin-package-publisher-trust@v1",
|
||||
"keys": [
|
||||
{
|
||||
"publisher": "REPLACE_WITH_PUBLISHER",
|
||||
"keyId": "REPLACE_WITH_KEY_ID",
|
||||
"publicKeyPem": "REPLACE_WITH_ED25519_PUBLIC_KEY_PEM",
|
||||
"notBeforeMs": 0,
|
||||
"notAfterMs": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"schema": "qinglong/plugin-package-registry-credentials@v1",
|
||||
"credentials": [
|
||||
{
|
||||
"registry": "registry.example.com",
|
||||
"scheme": "bearer",
|
||||
"token": "REPLACE_WITH_PRIVATE_REGISTRY_TOKEN"
|
||||
},
|
||||
{
|
||||
"registry": "registry-backup.example.com:5443",
|
||||
"scheme": "basic",
|
||||
"username": "REPLACE_WITH_PRIVATE_REGISTRY_USERNAME",
|
||||
"password": "REPLACE_WITH_PRIVATE_REGISTRY_PASSWORD"
|
||||
}
|
||||
]
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../cloudnative-pg
|
||||
|
||||
patches:
|
||||
- target:
|
||||
group: batch
|
||||
version: v1
|
||||
kind: Job
|
||||
labelSelector: app.kubernetes.io/name=ql3-plugin-package-recovery
|
||||
path: recover-job-patch.yaml
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: ql3-plugin-package-recovery
|
||||
namespace: qinglong3-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: recovery
|
||||
env:
|
||||
- name: QL3_PLUGIN_PACKAGE_REGISTRY_CREDENTIAL_FILE
|
||||
value: /var/run/secrets/qinglong3/plugin-package-registry/credentials.json
|
||||
volumeMounts:
|
||||
- name: plugin-package-registry-credentials
|
||||
mountPath: /var/run/secrets/qinglong3/plugin-package-registry
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: plugin-package-registry-credentials
|
||||
secret:
|
||||
secretName: ql3-plugin-package-registry-credentials
|
||||
defaultMode: 288
|
||||
items:
|
||||
- key: credentials.json
|
||||
path: credentials.json
|
||||
Reference in New Issue
Block a user