Created
April 26, 2018 22:18
-
-
Save joejulian/0b3b88745b077297ab7d045474205096 to your computer and use it in GitHub Desktop.
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
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