YAML ↔ JSON
YAML-Konfiguration in JSON und zurück umwandeln, mit Einrückungskontrolle und Beispielen für Kubernetes und GitHub Actions.
Läuft vollständig in Ihrem Browser – nichts, was Sie einfügen, wird hochgeladen.
Maps, Sequenzen, Flow-Stile, Strings in Anführungszeichen, Blockskalare und Kommentare werden unterstützt. Anker, Aliasse und Tags werden nicht aufgelöst.
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "ryuslog-web",
"labels": {
"app": "ryuslog",
"tier": "frontend"
}
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": {
"app": "ryuslog"
}
},
"template": {
"metadata": {
"labels": {
"app": "ryuslog"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": "ghcr.io/ryuslog/web:1.4.0",
"ports": [
{
"containerPort": 3000
}
],
"env": [
{
"name": "NODE_ENV",
"value": "production"
}
],
"resources": {
"limits": {
"cpu": "500m",
"memory": "512Mi"
}
},
"readinessProbe": {
"httpGet": {
"path": "/api/health",
"port": 3000
},
"initialDelaySeconds": 5,
"periodSeconds": 10
}
}
]
}
}
}
}YAML-Syntaxreferenz
Kurzreferenz- key: value
- Ein Map-Eintrag. Nach dem Doppelpunkt muss ein Leerzeichen stehen, Einrückung erfolgt mit Leerzeichen, nie mit Tabs.
- - item
- Sequenzeintrag auf seiner Einrückungsebene; untergeordnete Schlüssel richten sich am Elementtext aus.
- |
- Literaler Blockskalar, der Zeilenumbrüche behält – das Mittel für mehrzeilige Shell-Skripte und Konfigurationsdateien.
- >
- Gefalteter Blockskalar, der umbrochene Zeilen mit Leerzeichen verbindet, für einen langen Absatz.
- [a, b] / {k: v}
- Flow-Stil-Kurzform für eine kurze Sequenz oder Map in einer Zeile.
- # comment
- Kommentare reichen bis zum Zeilenende und gehen bei der Umwandlung in JSON verloren.
Passende Kubernetes-Syntax-Guides
Alle Kubernetes-GuidesKubernetes Pending Pod: CPU Requests, Unbound PVC, Taints
The scheduler event names every node and its reason. Requests versus allocatable, untolerated taints, zonal volume binding, and impossible anti-affinity.
KubernetesKubernetes Exit Code 137 OOMKilled vs Exit Code 134 Heap Limits
137 is SIGKILL from the cgroup or a liveness probe; 134 is an abort, usually V8's own heap ceiling. Telling them apart and sizing the two limits together.
KubernetesCrashLoopBackOff: Reading Exit Codes and Debugging Restart Loops
The backoff is only the waiting state. The evidence is in Last State, the exit code, and the previous container's last log line, and each points to a different fix.
KubernetesImagePullBackOff and ErrImagePull: Reading the Real Pull Error
ImagePullBackOff hides five different failures. The event text names which one: wrong reference, missing credentials, wrong architecture, unreachable registry, or a rate limit.