YAML ↔ JSON
Convierte configuración YAML en JSON y viceversa, con control de sangría y ejemplos de Kubernetes y GitHub Actions.
Se ejecuta por completo en tu navegador: nada de lo que pegues se sube.
Admite mapas, secuencias, estilos de flujo, cadenas entre comillas, escalares de bloque y comentarios. Los anclajes, alias y etiquetas no se expanden.
{
"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
}
}
]
}
}
}
}Referencia de sintaxis YAML
referencia rápida- key: value
- Entrada de un mapa. Los dos puntos deben ir seguidos de un espacio y la sangría usa espacios, nunca tabuladores.
- - item
- Entrada de secuencia en su nivel de sangría; las claves hijas se alinean bajo el texto del elemento.
- |
- Escalar de bloque literal que conserva los saltos de línea, usado en scripts de shell y archivos de configuración.
- >
- Escalar de bloque plegado que une las líneas con espacios, para un párrafo largo.
- [a, b] / {k: v}
- Abreviatura de estilo de flujo para una secuencia o mapa corto en una línea.
- # comment
- Los comentarios llegan hasta el final de la línea y se pierden al convertir a JSON.
Guías de sintaxis de Kubernetes
Todas las guías de KubernetesKubernetes 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.