# Open the file, paste your pull secret (from earlier), then Ctrl+O to save, Ctrl+X to exit
nano~/pull-secret.txt
# Restrict permissions so only you can read it
chmod600~/pull-secret.txt
使用文件启动 CRC:
1
crcstart--pull-secret-file~/pull-secret.txt
也可以不带参数直接运行 crc start,在提示时粘贴 secret。
这需要 10–15 分钟。 完成后你会看到类似以下输出:
1 2 3 4 5 6 7 8 9101112
Started the OpenShift cluster.
The server is accessible via web console at:
https://console-openshift-console.apps-crc.testing
Log in as administrator:
Username: kubeadmin
Password: <generated-password>
Log in as user:
Username: developer
Password: developer
# n8n-standalone-values.yaml# Single pod, SQLite database, no external dependencies.queueMode:enabled:falsedatabase:type:sqliteuseExternal:falseredis:enabled:false# PVC stores the SQLite database file.persistence:enabled:truesize:5Gi# No storageClassName needed — CRC provides a default storage provisioner.secretRefs:existingSecret:"n8n-secrets"service:type:ClusterIPport:5678# OpenShift: securityContext must be enabled so the pod runs as UID 1000 (node user)# with fsGroup 1000 (so the PVC is writable). The anyuid SCC granted above# allows this. The seccompProfile line is removed from the chart template in# "Deploy n8n" because OpenShift 4.14+ rejects it even with anyuid.securityContext:enabled:trueresources:main:requests:cpu:100mmemory:256Milimits:cpu:"1"memory:1Giconfig:timezone:UTC
helmpulloci://ghcr.io/n8n-io/n8n-helm-chart/n8n--version1.0.3--untar
sed-i'/seccompProfile:/d; /type: RuntimeDefault/d'~/n8n/templates/deployment-main.yaml
# Confirm the lines are gone (should return no output)
grep-n"seccomp\|RuntimeDefault"~/n8n/templates/deployment-main.yaml
# Database password (must match what you set when installing PostgreSQL)
occreatesecretgenericn8n-enterprise-db-secret\--namespace$NAMESPACE\--from-literal=password='YourStrongPassword123'# MinIO credentials
occreatesecretgenericn8n-minio-secret\--namespace$NAMESPACE\--from-literal=root-password='MinioStrongPassword123'
# n8n-multimain-ocp-values.yaml# Multi-instance queue mode for OpenShift Local (CRC).# Uses in-cluster PostgreSQL, Redis, and MinIO instead of AWS services.# Requires Enterprise license.# --- Enterprise license ---license:enabled:trueactivationKey:"your-enterprise-license-key-here"# <-- REPLACE# --- Multi-main: 2 replicas (reduced for local resources) ---multiMain:enabled:truereplicas:2# --- Queue mode: 2 worker pods ---queueMode:enabled:trueworkerReplicaCount:2workerConcurrency:5# --- Webhook processors ---webhookProcessor:enabled:truereplicaCount:1disableProductionWebhooksOnMainProcess:true# --- PostgreSQL (in-cluster) ---database:type:postgresdbuseExternal:truehost:"postgresql.YOUR_NAMESPACE.svc.cluster.local"# <-- REPLACE YOUR_NAMESPACEport:5432database:n8n_enterpriseschema:"public"user:n8npasswordSecret:name:"n8n-enterprise-db-secret"key:"password"# --- Redis (in-cluster, no TLS) ---redis:enabled:trueuseExternal:truehost:"redis-master.YOUR_NAMESPACE.svc.cluster.local"# <-- REPLACE YOUR_NAMESPACEport:6379tls:false# --- MinIO (S3-compatible, in-cluster) ---s3:enabled:truebucket:name:"n8n-data"region:"us-east-1"host:"http://minio:9000"auth:autoDetect:falseaccessKeyId:"minioadmin"secretAccessKeySecret:name:"n8n-minio-secret"key:"root-password"storage:mode:"s3"availableModes:"filesystem,s3"forcePathStyle:true# --- Service account ---serviceAccount:create:truename:n8n
保存并退出 nano(Ctrl+O,Ctrl+X)。
在部署之前,将两个 YOUR_NAMESPACE 占位符替换为你的实际 Namespace 值:
12345
# Check your namespace valueecho$NAMESPACE# Replace in the file (this edits it automatically)
sed-i"s/YOUR_NAMESPACE/$NAMESPACE/g"n8n-multimain-ocp-values.yaml
# Remove the old local chart copy
rm-rf~/n8n/
# Pull and patch the new version
helmpulloci://ghcr.io/n8n-io/n8n-helm-chart/n8n--version<new-version>--untar
sed-i'/seccompProfile:/d; /type: RuntimeDefault/d'~/n8n/templates/deployment-main.yaml
# Standalone
helmupgraden8n~/n8n/\--namespace$NAMESPACE\--valuesn8n-standalone-values.yaml
# Multi-instance
helmupgraden8n~/n8n/\--namespace$NAMESPACE\--valuesn8n-multimain-ocp-values.yaml
如果你看到 unable to validate against any security context constraint 或 seccomp may not be set,说明 chart 中硬编码的 seccompProfile: RuntimeDefault 被拒绝了。OpenShift 4.14+ 将其转换为已弃用的 alpha 注解,即使授予了 anyuid SCC,准入控制也会拒绝。
1. 使用显式形式授予 anyuid(简写的 -z 可能会静默失败):
1234567
# For standalone
ocadmpolicyadd-scc-to-useranyuid\system:serviceaccount:$NAMESPACE:n8n
# For multi-instance
ocadmpolicyadd-scc-to-useranyuid\system:serviceaccount:$NAMESPACE:n8n-enterprise
验证:运行 oc get rolebindings -n $NAMESPACE,应能看到 system:openshift:scc:anyuid 的绑定。
# Main process
oclogs-n$NAMESPACE-lapp.kubernetes.io/component=main--tail=50# Workers
oclogs-n$NAMESPACE-lapp.kubernetes.io/component=worker--tail=50# Webhook processors
oclogs-n$NAMESPACE-lapp.kubernetes.io/component=webhook-processor--tail=50