YAML ↔ JSON
Converta configuração YAML em JSON e vice-versa, com controle de indentação e exemplos de Kubernetes e GitHub Actions.
Roda totalmente no seu navegador: nada do que você cola é enviado.
Suporta mapas, sequências, estilos de fluxo, strings entre aspas, escalares de bloco e comentários. Âncoras, aliases e tags não são expandidos.
{
"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
}
}
]
}
}
}
}Referência de sintaxe YAML
referência rápida- key: value
- Entrada de mapa. Os dois-pontos precisam de um espaço depois e a indentação usa espaços, nunca tabulação.
- - item
- Entrada de sequência no próprio nível de indentação; as chaves filhas alinham sob o texto do item.
- |
- Escalar de bloco literal que mantém as quebras de linha, usado em scripts de shell e arquivos de configuração.
- >
- Escalar de bloco dobrado que une as linhas com espaços, para um parágrafo longo.
- [a, b] / {k: v}
- Abreviação de estilo de fluxo para uma sequência ou mapa curto em uma linha.
- # comment
- Comentários vão até o fim da linha e são perdidos ao converter para JSON.
Guias de sintaxe de Kubernetes
Todos os guias 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.