MOF, Dash und MCP in einem Pod.
Linux amd64 · kubectl · Externes PostgreSQL · 1 Pod · 3 Container
Privates Netzwerk · Berechtigung CREATEDB erforderlich · PostgreSQL nur mit TLS nicht unterstützt.
Image-Quelle
mof.yaml herunterladen
Docker Hub · MOF v2.0.15 · Dash v2.0.17 · MCP v2.0.3
Herunterladen mof.yaml ↓Datei anzeigen
# 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
Herunterladen mof.yaml ↓Datei anzeigen
# 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
Herunterladen mof.yaml ↓Datei anzeigen
# 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
Behalten Sie die Service-Namen mof, mof-mcp und dash bei, alle in einem Namespace. Die Komponenten finden sich über diese Namen (mof:8080, mof-mcp:8001), daher ist nichts weiter zu konfigurieren; umbenannte Services können sich nicht verbinden.
Datenbankverbindung
Tragen Sie Ihr vorhandenes PostgreSQL in mof.yaml ein:
RK_POSTGRES_0_ADDR- Adresse:Port
RK_POSTGRES_0_USER- Benutzername
stringData.password- Vorhandenes Datenbankpasswort
Setzen Sie Passwörter in Anführungszeichen und halten Sie diese Datei privat.
Bereitstellen
kubectl apply -f mof.yaml
kubectl -n mof rollout status deployment/mof --timeout=10m
kubectl -n mof rollout status deployment/mof-mcp deployment/dashSobald alle drei ausgerollt sind, holen Sie das Admin-Passwort:
kubectl -n mof logs deployment/mof | grep "Admin password"MOF öffnen
kubectl -n mof port-forward service/dash 8000:80Lassen Sie dieses Terminal laufen.
http://127.0.0.1:8000/adminInstallieren Sie Ihre Lizenz und legen Sie Benutzer an.
http://127.0.0.1:8000Melden Sie sich mit Ihrem MOF-Konto an.
Erweiterte Konfiguration
PostgreSQL-TLS-Kompatibilität
MOF wendet TLS-Einstellungen auf Mof und AsyncJobMof an, aber nicht auf Provider-Datenbanken. Diese Vorlage erfordert ein vertrauenswürdiges privates Netzwerk und kann kein PostgreSQL nur mit TLS verwenden.
Domain, HTTPS und optionales OAuth
Verwenden Sie einen vorhandenen Ingress-Controller und richten Sie Ihre Domain darauf aus. Setzen Sie Klasse, Hostname und ein vorhandenes TLS-Secret im Namespace mof.
Herunterladen 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 ingressAktivieren Sie MCP unter Admin → Einstellungen → MCP. Endpunkt: /v1/mof/remote-mcp. Tokens benötigen kein OAuth; Browser-OAuth erfordert HTTPS, MOF_PUBLIC_URL und MOF_MCP_OAUTH_SECRET.
Health Checks und Fehlerbehebung
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/healthErwartet: mof, mof-mcp und dash Running und Ready; MCP ready: true. Prüfen Sie bei Startfehlern Image-Pulls, Knotenarchitektur und Datenbankzugriff.
Vorlagenparameter
RK_POSTGRES_0_ADDRHostname:Port des externen PostgreSQL, vom Pod erreichbar.RK_POSTGRES_0_USERVorhandene Datenbankrolle mit der Berechtigung, MOF- und Provider-Datenbanken anzulegen.mof-database / passwordDatenbankpasswort in einem Secret gespeichert; nur in MOF injiziert.Services mof / mof-mcp / dashJe ein Deployment und ein Service. Sie finden sich über den Service-Namen; nichts zu setzen.replicas / strategy1 / Recreate. Upgrades unterbrechen den Dienst kurz; Hochverfügbarkeit mit mehreren Replikas liegt außerhalb dieser Vorlage.resources.requestsScheduling-Reservierungen, keine Speicherlimits. Dimensionieren Sie MOF nach Ihrem Rechnungsvolumen und überwachen Sie die tatsächliche Nutzung.offer-cache / emptyDirWiederaufbaubarer öffentlicher Preis-Cache. Geht verloren, wenn der Pod ersetzt wird; Abrechnungsdaten bleiben in PostgreSQL.ingressClassName / host / tlsAn Ihren installierten Controller, die öffentliche Domain und das TLS-Secret anpassen. Optional für lokale Prüfungen per port-forward.Updates, Daten und Skalierung
Sichern Sie PostgreSQL, aktualisieren Sie die Image-Versionen und wenden Sie mof.yaml an. Starten Sie nach Änderungen an ConfigMap oder Secret neu. Recreate-Upgrades unterbrechen den Dienst.
kubectl -n mof rollout restart deployment/mof
kubectl -n mof rollout status deployment/mof --timeout=10mNur eine Replika; bedarfsgesteuerte Kubernetes-Jobs sind nicht implementiert. Anwendungsdaten bleiben im externen PostgreSQL; der Preis-Cache lässt sich neu aufbauen.