Last active
August 15, 2018 17:09
-
-
Save evanlouie/c00722a77caa6f217224fc4b3964399d to your computer and use it in GitHub Desktop.
Create a namespaced service instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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