Skip to content

Instantly share code, notes, and snippets.

@evanlouie
Last active August 15, 2018 17:09
Show Gist options
  • Save evanlouie/c00722a77caa6f217224fc4b3964399d to your computer and use it in GitHub Desktop.
Save evanlouie/c00722a77caa6f217224fc4b3964399d to your computer and use it in GitHub Desktop.
Create a namespaced service instance
const provision = (name: string, namespace: string, location: string, resourceGroup: string) =>
fetch(
`http://localhost:8001/apis/servicecatalog.k8s.io/v1beta1/namespaces/${namespace}/serviceinstances`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
apiVersion: "servicecatalog.k8s.io/v1beta1",
kind: "ServiceInstance",
metadata: {
name,
},
spec: {
serviceClassExternalName: "azure-storage",
servicePlanExternalName: "blob-container",
parameters: {
location,
resourceGroup,
},
},
}),
},
);
provision("foobar", "default", "westus2", "testing");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment