Skip to content

Instantly share code, notes, and snippets.

@gokart23
Created February 9, 2018 11:16
Show Gist options
  • Save gokart23/d1ff74334ba7910e65483ce1143a6f24 to your computer and use it in GitHub Desktop.
Save gokart23/d1ff74334ba7910e65483ce1143a6f24 to your computer and use it in GitHub Desktop.
Kubernetes REST API for `kubectl apply -f <file>`
# Kubernetes Server: 1.3
# If this is the first time that apply is being called
curl -X POST -H "Content-Type: application/json" "${KUBERNETES_API_SERVER}"/apis/extensions/v1beta1/namespaces/my-namespace/deployments/ --data @my-deployment-spec.json
# If this is the first time that apply is being called
curl -X PATCH -H "Content-Type: application/json-patch+json" "${KUBERNETES_API_SERVER}"/apis/extensions/v1beta1/namespaces/my-namespace/deployments/my-deployment --data @my-deployment-spec.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment