Skip to content

Instantly share code, notes, and snippets.

@achoimet
Created May 10, 2020 19:34
Show Gist options
  • Save achoimet/0f75db02917c3d841d0d347e9c018c44 to your computer and use it in GitHub Desktop.
Save achoimet/0f75db02917c3d841d0d347e9c018c44 to your computer and use it in GitHub Desktop.
deployment := &unstructured.Unstructured{
Object: map[string]interface{}{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]interface{}{
"name": "demo-deployment",
},
"spec": map[string]interface{}{
"replicas": 2,
"selector": map[string]interface{}{
"matchLabels": map[string]interface{}{
"app": "demo",
},
},
"template": map[string]interface{}{
"metadata": map[string]interface{}{
"labels": map[string]interface{}{
"app": "demo",
},
},
"spec": map[string]interface{}{
"containers": []map[string]interface{}{
{
"name": "web",
"image": "nginx:1.12",
"ports": []map[string]interface{}{
{
"name": "http",
"protocol": "TCP",
"containerPort": 80,
},
},
},
},
},
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment