MOF, Dash, dan MCP dalam satu Pod.
Linux amd64 · kubectl · PostgreSQL eksternal · 1 Pod · 3 container
Jaringan privat · izin CREATEDB diperlukan · PostgreSQL khusus TLS tidak didukung.
Sumber image
Unduh mof.yaml
Docker Hub · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3
Unduh mof.yaml ↓Lihat file
# MOF v2.0.15 + Dash v2.0.17 + MCP v2.0.3
# Edit database address, user and password before applying. Keep this file private.
# Keep the Service names mof, mof-mcp and dash, all in one namespace: the components find each
# other by them (mof:8080, mof-mcp:8001). Renamed Services can't connect.
# Private-network PostgreSQL without TLS. TLS-only databases are not supported by this release.
apiVersion: v1
kind: Namespace
metadata:
name: mof
---
apiVersion: v1
kind: Secret
metadata:
name: mof-database
namespace: mof
type: Opaque
stringData:
password: "REPLACE_WITH_YOUR_DATABASE_PASSWORD"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mof-config
namespace: mof
data:
RK_POSTGRES_0_ADDR: "db.example.com:5432"
RK_POSTGRES_0_USER: "mof"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof
namespace: mof
spec:
replicas: 1
# First-release template: stop the old Pod before starting the new version.
strategy:
type: Recreate
selector:
matchLabels:
app: mof
template:
metadata:
labels:
app: mof
# Prometheus discovery by annotation; see the monitoring guide for a PodMonitor
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /internal/v1/mof/metrics
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
terminationGracePeriodSeconds: 120
containers:
- name: mof
image: mofcloud/mof:v2.0.15
envFrom:
- configMapRef:
name: mof-config
env:
- name: RK_POSTGRES_0_PASS
valueFrom:
secretKeyRef:
name: mof-database
key: password
ports:
- name: api
containerPort: 8080
startupProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
failureThreshold: 60
readinessProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "500m"
memory: "1Gi"
volumeMounts:
- name: offer-cache
mountPath: /usr/src/mof/offer-cache
volumes:
- name: offer-cache
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: mof
namespace: mof
spec:
selector:
app: mof
ports:
- name: api
port: 8080
targetPort: api
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof-mcp
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: mof-mcp
template:
metadata:
labels:
app: mof-mcp
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: mof-mcp
image: mofcloud/mof-mcp:v2.0.3
ports:
- name: mcp
containerPort: 8001
readinessProbe:
exec:
command: ["node", "/app/build/healthcheck.js"]
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "100m"
memory: "128Mi"
---
apiVersion: v1
kind: Service
metadata:
name: mof-mcp
namespace: mof
spec:
selector:
app: mof-mcp
ports:
- name: mcp
port: 8001
targetPort: mcp
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dash
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: dash
template:
metadata:
labels:
app: dash
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: dash
image: mofcloud/dash:v2.0.17
ports:
- name: web
containerPort: 80
readinessProbe:
httpGet:
path: /
port: web
periodSeconds: 10
resources:
requests:
cpu: "100m"
memory: "64Mi"
---
apiVersion: v1
kind: Service
metadata:
name: dash
namespace: mof
spec:
selector:
app: dash
ports:
- name: web
port: 80
targetPort: web
type: ClusterIP
Alibaba Cloud ACR · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3
Unduh mof.yaml ↓Lihat file
# MOF v2.0.15 + Dash v2.0.17 + MCP v2.0.3
# Edit database address, user and password before applying. Keep this file private.
# Keep the Service names mof, mof-mcp and dash, all in one namespace: the components find each
# other by them (mof:8080, mof-mcp:8001). Renamed Services can't connect.
# Private-network PostgreSQL without TLS. TLS-only databases are not supported by this release.
apiVersion: v1
kind: Namespace
metadata:
name: mof
---
apiVersion: v1
kind: Secret
metadata:
name: mof-database
namespace: mof
type: Opaque
stringData:
password: "REPLACE_WITH_YOUR_DATABASE_PASSWORD"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mof-config
namespace: mof
data:
RK_POSTGRES_0_ADDR: "db.example.com:5432"
RK_POSTGRES_0_USER: "mof"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof
namespace: mof
spec:
replicas: 1
# First-release template: stop the old Pod before starting the new version.
strategy:
type: Recreate
selector:
matchLabels:
app: mof
template:
metadata:
labels:
app: mof
# Prometheus discovery by annotation; see the monitoring guide for a PodMonitor
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /internal/v1/mof/metrics
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
terminationGracePeriodSeconds: 120
containers:
- name: mof
image: registry.cn-hangzhou.aliyuncs.com/mofcloud/mof:v2.0.15
envFrom:
- configMapRef:
name: mof-config
env:
- name: RK_POSTGRES_0_PASS
valueFrom:
secretKeyRef:
name: mof-database
key: password
ports:
- name: api
containerPort: 8080
startupProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
failureThreshold: 60
readinessProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "500m"
memory: "1Gi"
volumeMounts:
- name: offer-cache
mountPath: /usr/src/mof/offer-cache
volumes:
- name: offer-cache
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: mof
namespace: mof
spec:
selector:
app: mof
ports:
- name: api
port: 8080
targetPort: api
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof-mcp
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: mof-mcp
template:
metadata:
labels:
app: mof-mcp
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: mof-mcp
image: registry.cn-hangzhou.aliyuncs.com/mofcloud/mof-mcp:v2.0.3
ports:
- name: mcp
containerPort: 8001
readinessProbe:
exec:
command: ["node", "/app/build/healthcheck.js"]
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "100m"
memory: "128Mi"
---
apiVersion: v1
kind: Service
metadata:
name: mof-mcp
namespace: mof
spec:
selector:
app: mof-mcp
ports:
- name: mcp
port: 8001
targetPort: mcp
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dash
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: dash
template:
metadata:
labels:
app: dash
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: dash
image: registry.cn-hangzhou.aliyuncs.com/mofcloud/dash:v2.0.17
ports:
- name: web
containerPort: 80
readinessProbe:
httpGet:
path: /
port: web
periodSeconds: 10
resources:
requests:
cpu: "100m"
memory: "64Mi"
---
apiVersion: v1
kind: Service
metadata:
name: dash
namespace: mof
spec:
selector:
app: dash
ports:
- name: web
port: 80
targetPort: web
type: ClusterIP
GHCR · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3
Unduh mof.yaml ↓Lihat file
# MOF v2.0.15 + Dash v2.0.17 + MCP v2.0.3
# Edit database address, user and password before applying. Keep this file private.
# Keep the Service names mof, mof-mcp and dash, all in one namespace: the components find each
# other by them (mof:8080, mof-mcp:8001). Renamed Services can't connect.
# Private-network PostgreSQL without TLS. TLS-only databases are not supported by this release.
apiVersion: v1
kind: Namespace
metadata:
name: mof
---
apiVersion: v1
kind: Secret
metadata:
name: mof-database
namespace: mof
type: Opaque
stringData:
password: "REPLACE_WITH_YOUR_DATABASE_PASSWORD"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mof-config
namespace: mof
data:
RK_POSTGRES_0_ADDR: "db.example.com:5432"
RK_POSTGRES_0_USER: "mof"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof
namespace: mof
spec:
replicas: 1
# First-release template: stop the old Pod before starting the new version.
strategy:
type: Recreate
selector:
matchLabels:
app: mof
template:
metadata:
labels:
app: mof
# Prometheus discovery by annotation; see the monitoring guide for a PodMonitor
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /internal/v1/mof/metrics
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
terminationGracePeriodSeconds: 120
containers:
- name: mof
image: ghcr.io/mofcloud/mof:v2.0.15
envFrom:
- configMapRef:
name: mof-config
env:
- name: RK_POSTGRES_0_PASS
valueFrom:
secretKeyRef:
name: mof-database
key: password
ports:
- name: api
containerPort: 8080
startupProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
failureThreshold: 60
readinessProbe:
httpGet:
path: /v1/mof/site-info
port: api
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "500m"
memory: "1Gi"
volumeMounts:
- name: offer-cache
mountPath: /usr/src/mof/offer-cache
volumes:
- name: offer-cache
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: mof
namespace: mof
spec:
selector:
app: mof
ports:
- name: api
port: 8080
targetPort: api
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mof-mcp
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: mof-mcp
template:
metadata:
labels:
app: mof-mcp
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: mof-mcp
image: ghcr.io/mofcloud/mof-mcp:v2.0.3
ports:
- name: mcp
containerPort: 8001
readinessProbe:
exec:
command: ["node", "/app/build/healthcheck.js"]
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "100m"
memory: "128Mi"
---
apiVersion: v1
kind: Service
metadata:
name: mof-mcp
namespace: mof
spec:
selector:
app: mof-mcp
ports:
- name: mcp
port: 8001
targetPort: mcp
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dash
namespace: mof
spec:
replicas: 1
selector:
matchLabels:
app: dash
template:
metadata:
labels:
app: dash
spec:
enableServiceLinks: false
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: dash
image: ghcr.io/mofcloud/dash:v2.0.17
ports:
- name: web
containerPort: 80
readinessProbe:
httpGet:
path: /
port: web
periodSeconds: 10
resources:
requests:
cpu: "100m"
memory: "64Mi"
---
apiVersion: v1
kind: Service
metadata:
name: dash
namespace: mof
spec:
selector:
app: dash
ports:
- name: web
port: 80
targetPort: web
type: ClusterIP
Pertahankan nama Service mof, mof-mcp, dan dash, semuanya dalam satu namespace. Komponen saling menemukan lewat nama ini (mof:8080, mof-mcp:8001), jadi tidak ada lagi yang perlu dikonfigurasi; Service yang diganti namanya tidak dapat terhubung.
Koneksi database
Isi PostgreSQL Anda yang sudah ada di mof.yaml:
RK_POSTGRES_0_ADDR- Alamat:port
RK_POSTGRES_0_USER- Nama pengguna
stringData.password- Kata sandi database yang ada
Beri tanda kutip pada kata sandi dan jaga file ini tetap privat.
Deploy
kubectl apply -f mof.yaml
kubectl -n mof rollout status deployment/mof --timeout=10m
kubectl -n mof rollout status deployment/mof-mcp deployment/dashSetelah ketiganya selesai di-rollout, ambil kata sandi Admin:
kubectl -n mof logs deployment/mof | grep "Admin password"Buka MOF
kubectl -n mof port-forward service/dash 8000:80Biarkan terminal ini tetap berjalan.
http://127.0.0.1:8000/adminPasang lisensi Anda dan buat pengguna.
http://127.0.0.1:8000Masuk dengan akun MOF Anda.
Konfigurasi lanjutan
Kompatibilitas TLS PostgreSQL
MOF menerapkan pengaturan TLS ke Mof dan AsyncJobMof, tetapi tidak ke database provider. Template ini memerlukan jaringan privat tepercaya dan tidak dapat memakai PostgreSQL khusus TLS.
Domain, HTTPS, dan OAuth opsional
Gunakan Ingress controller yang ada dan arahkan domain Anda ke sana. Atur class, hostname, dan TLS Secret yang ada di namespace mof.
Unduh ingress.yaml ↓# Requires an installed Ingress controller and an existing TLS Secret.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mof
namespace: mof
spec:
ingressClassName: nginx
tls:
- hosts: [mof.example.com]
secretName: mof-web-tls
rules:
- host: mof.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: dash
port:
number: 80
kubectl apply -f ingress.yaml
kubectl -n mof get ingressAktifkan MCP di Admin → Pengaturan → MCP. Endpoint: /v1/mof/remote-mcp. Token tidak memerlukan OAuth; OAuth browser memerlukan HTTPS, MOF_PUBLIC_URL, dan MOF_MCP_OAUTH_SECRET.
Health check dan pemecahan masalah
kubectl -n mof get pods
kubectl -n mof logs deployment/mof --tail=100
kubectl -n mof logs deployment/mof-mcp --tail=60
kubectl -n mof logs deployment/dash --tail=60
kubectl -n mof exec deployment/mof -- wget -q -O - http://mof-mcp:8001/healthDiharapkan: mof, mof-mcp, dan dash Running dan Ready; MCP ready: true. Periksa pull image, arsitektur node, dan akses database jika startup gagal.
Parameter template
RK_POSTGRES_0_ADDRHostname:port PostgreSQL eksternal, dapat dijangkau dari Pod.RK_POSTGRES_0_USERRole database yang ada dengan izin membuat database MOF dan provider.mof-database / passwordKata sandi database disimpan di Secret; hanya disuntikkan ke MOF.Services mof / mof-mcp / dashMasing-masing satu Deployment dan Service. Mereka saling menemukan lewat nama Service; tidak ada yang perlu diatur.replicas / strategy1 / Recreate. Upgrade menghentikan layanan sebentar; HA multi-replika di luar cakupan template ini.resources.requestsReservasi penjadwalan, bukan batas memori. Sesuaikan ukuran MOF dengan volume tagihan Anda dan pantau penggunaan sebenarnya.offer-cache / emptyDirCache harga publik yang dapat dibangun ulang. Hilang saat Pod diganti; data tagihan tetap di PostgreSQL.ingressClassName / host / tlsSesuaikan dengan controller yang terpasang, domain publik, dan TLS Secret Anda. Opsional untuk pemeriksaan port-forward lokal.Pembaruan, data, dan penskalaan
Cadangkan PostgreSQL, perbarui versi image, dan terapkan mof.yaml. Restart setelah perubahan ConfigMap atau Secret. Upgrade Recreate menghentikan layanan.
kubectl -n mof rollout restart deployment/mof
kubectl -n mof rollout status deployment/mof --timeout=10mHanya satu replika; Kubernetes Job sesuai permintaan belum diimplementasikan. Data aplikasi tetap di PostgreSQL eksternal; cache harga dapat dibangun ulang.