Created
November 20, 2018 23:02
-
-
Save alias-dev/849291b6059a74d5c76edadd80dccb59 to your computer and use it in GitHub Desktop.
Proposed Nutanix Karbon schema
This file contains 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
func resourceNutanixKarbonCluster() *schema.Resource { | |
return &schema.Resource{ | |
Create: resourceNutanixKarbonClusterCreate, | |
Read: resourceNutanixKarbonClusterRead, | |
Delete: resourceNutanixKarbonClusterDelete, | |
Schema: map[string]*schema.Schema{ | |
"name": { | |
Type: schema.TypeString, | |
Required: true, | |
ForceNew: true, | |
}, | |
"description": { | |
Type: schema.TypeString, | |
Optional: true, | |
ForceNew: true, | |
}, | |
"kubernetes_version": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "v1.10.3", | |
ForceNew: true, | |
}, | |
"fqdn": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "", | |
ForceNew: true, | |
}, | |
"logging": { | |
Type: schema.TypeBool, | |
Optional: true, | |
Default: false, | |
ForceNew: true, | |
}, | |
"uuid": { | |
Type: schema.TypeMap, | |
Required: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"network": { | |
Type: schema.TypeString, | |
Required: true, | |
}, | |
"cluster": { | |
Type: schema.TypeString, | |
Required: true, | |
}, | |
"image": { | |
Type: schema.TypeString, | |
Required: true, | |
}, | |
}, | |
}, | |
}, | |
"cidr": { | |
Type: schema.TypeMap, | |
Required: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"service": { | |
Type: schema.TypeString, | |
Required: true, | |
}, | |
"pod": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "172.20.0.0/16", | |
}, | |
}, | |
}, | |
}, | |
"masters": { | |
Type: schema.TypeMap, | |
Optional: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"cpu": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 2, | |
}, | |
"memory_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 4096, | |
}, | |
"disk_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 122880, | |
}, | |
}, | |
}, | |
}, | |
"workers": { | |
Type: schema.TypeMap, | |
Optional: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"count": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 3, | |
}, | |
"cpu": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 4, | |
}, | |
"memory_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 8192, | |
}, | |
"disk_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 122880, | |
}, | |
}, | |
}, | |
}, | |
"etcd": { | |
Type: schema.TypeMap, | |
Optional: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"count": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 3, | |
}, | |
"cpu": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 2, | |
}, | |
"memory_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 8192, | |
}, | |
"disk_mib": { | |
Type: schema.TypeInt, | |
Optional: true, | |
Default: 40960, | |
}, | |
}, | |
}, | |
}, | |
"storage_class": { | |
Type: schema.TypeMap, | |
Optional: true, | |
ForceNew: true, | |
Elem: &schema.Resource{ | |
Schema: map[string]*schema.Schema{ | |
"name": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "default-storageclass", | |
}, | |
"container": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "SelfServiceContainer", | |
}, | |
"file_system": { | |
Type: schema.TypeString, | |
Optional: true, | |
Default: "ext4", | |
}, | |
"flash_mode": { | |
Type: schema.TypeBool, | |
Optional: true, | |
Default: false, | |
}, | |
}, | |
}, | |
}, | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment