Skip to content

Instantly share code, notes, and snippets.

@joejulian
Created April 26, 2018 22:18
Show Gist options
  • Save joejulian/0b3b88745b077297ab7d045474205096 to your computer and use it in GitHub Desktop.
Save joejulian/0b3b88745b077297ab7d045474205096 to your computer and use it in GitHub Desktop.
package main
import (
"github.com/dstorck/gogo"
)
func main() {
// This data should come from the resource.
maasEndpoint := "https://192.168.2.24/MAAS/api/2.0"
clusterName := "fred"
maasUserName := "jjulian"
maasPassword := "supersecretpassword" //This is fake data. Replace with your own.
// This is the structure that defines a cluster for a resource.
cluster := gogo.Juju{
Name: clusterName,
Bundle: "cs:bundle/kubernetes-core-306", // This should probably come from a config setting eventually.
Cl: gogo.Cloud{
Type: clusterName,
Endpoint: maasEndpoint,
},
Cr: gogo.Credentials{
CloudName: clusterName,
Username: maasUserName,
MaasOauth: maasPassword,
},
}
cluster.SetCloudAndCreds()
cluster.Spinup()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment