Documentation ¶
Overview ¶
Package acsengine takes an ACS cluster model and generates the corresponding template
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CreatePki(masterFQDN string, extraFQDNs []string, extraIPs []net.IP, ...) (*PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, error)
- func FormatAzureProdFQDN(fqdnPrefix string, location string) string
- func FormatAzureProdFQDNs(fqdnPrefix string) []string
- func GenerateClusterID(properties *api.Properties) string
- func GenerateKubeConfig(properties *api.Properties, location string) (string, error)
- func GetAgentAllowedSizes() string
- func GetClassicAllowedSizes() string
- func GetClassicSizeMap() string
- func GetMasterAllowedSizes() string
- func GetSizeMap() string
- func MustAsset(name string) []byte
- func PrettyPrintArmTemplate(template string) (string, error)
- func PrettyPrintJSON(content string) (string, error)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SetPropertiesDefaults(p *api.Properties) (bool, error)
- type DCOSNodeType
- type PkiKeyCertPair
- type TemplateGenerator
- type V20160330ContainerService
- type VlabsContainerService
Constants ¶
const ( // DefaultMasterSubnet specifies the default master subnet for DCOS or Swarm DefaultMasterSubnet = "172.16.0.0/24" // DefaultFirstConsecutiveStaticIP specifies the static IP address on master 0 for DCOS or Swarm DefaultFirstConsecutiveStaticIP = "172.16.0.5" // DefaultSwarmWindowsMasterSubnet specifies the default master subnet for a Swarm Windows cluster DefaultSwarmWindowsMasterSubnet = "192.168.255.0/24" // DefaultSwarmWindowsFirstConsecutiveStaticIP specifies the static IP address on master 0 for a Swarm WIndows cluster DefaultSwarmWindowsFirstConsecutiveStaticIP = "192.168.255.5" // DefaultKubernetesMasterSubnet specifies the default kubernetes master subnet DefaultKubernetesMasterSubnet = "10.240.0.0/16" // DefaultFirstConsecutiveKubernetesStaticIP specifies the static IP address on Kubernetes master 0 DefaultFirstConsecutiveKubernetesStaticIP = "10.240.255.5" // DefaultAgentSubnetTemplate specifies a default agent subnet DefaultAgentSubnetTemplate = "10.%d.0.0/16" // DefaultKubernetesClusterDomain is the dns suffix used in the cluster (used as a SAN in the PKI generation) DefaultKubernetesClusterDomain = "cluster.local" // DefaultKubernetesHyperkubeSpec is the default version used for Kubernetes setup // The latest stable version can be found here: https://storage.googleapis.com/kubernetes-release/release/stable.txt DefaultKubernetesHyperkubeSpec = "gcr.io/google_containers/hyperkube-amd64:v1.4.6" // DefaultKubectlVersion is the version used for kubectl // The latest stable version can be found here: https://storage.googleapis.com/kubernetes-release/release/stable.txt DefaultKubectlVersion = "v1.4.6" )
const ( ValidityDuration = time.Hour * 24 * 365 * 2 PkiKeySize = 4096 )
const (
// AzureProdFQDNFormat specifies the format for a prod dns name
AzureProdFQDNFormat = "%s.%s.cloudapp.azure.com"
)
Variables ¶
var AzureLocations = []string{
"australiaeast",
"australiasoutheast",
"brazilsouth",
"canadacentral",
"canadaeast",
"centralindia",
"centralus",
"eastasia",
"eastus",
"eastus2",
"japaneast",
"japanwest",
"northcentralus",
"northeurope",
"southcentralus",
"southeastasia",
"southindia",
"uksouth",
"ukwest",
"westcentralus",
"westeurope",
"westindia",
"westus",
"westus2",
}
AzureLocations provides all azure regions in prod. Related powershell to refresh this list:
Get-AzureRmLocation | Select-Object -Property Location
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func CreatePki ¶
func CreatePki(masterFQDN string, extraFQDNs []string, extraIPs []net.IP, clusterDomain string) (*PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, error)
func FormatAzureProdFQDN ¶
FormatAzureProdFQDN constructs an Azure prod fqdn
func FormatAzureProdFQDNs ¶
FormatAzureProdFQDNs constructs all possible Azure prod fqdn
func GenerateClusterID ¶
func GenerateClusterID(properties *api.Properties) string
GenerateClusterID creates a unique 8 string cluster ID
func GenerateKubeConfig ¶
func GenerateKubeConfig(properties *api.Properties, location string) (string, error)
GenerateKubeConfig returns a JSON string representing the KubeConfig
func GetAgentAllowedSizes ¶
func GetAgentAllowedSizes() string
GetAgentAllowedSizes returns the agent allowed sizes
func GetClassicAllowedSizes ¶
func GetClassicAllowedSizes() string
GetAgentAllowedSizes returns the agent allowed sizes
func GetMasterAllowedSizes ¶
func GetMasterAllowedSizes() string
GetMasterAllowedSizes returns the master allowed sizes
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PrettyPrintArmTemplate ¶
PrettyPrintArmTemplate will pretty print the arm template ensuring ordered by params, vars, resources, and outputs
func PrettyPrintJSON ¶
PrettyPrintJSON will pretty print the json into
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func SetPropertiesDefaults ¶
func SetPropertiesDefaults(p *api.Properties) (bool, error)
SetPropertiesDefaults for the container Properties, returns true if certs are generated
Types ¶
type DCOSNodeType ¶
type DCOSNodeType string
DCOSNodeType represents the type of DCOS Node
const ( // Master represents the master node type DCOSMaster DCOSNodeType = "DCOSMaster" // PrivateAgent represents the private agent node type DCOSPrivateAgent DCOSNodeType = "DCOSPrivateAgent" // PublicAgent represents the public agent node type DCOSPublicAgent DCOSNodeType = "DCOSPublicAgent" )
type PkiKeyCertPair ¶
type TemplateGenerator ¶
type TemplateGenerator struct {
ClassicMode bool
}
TemplateGenerator represents the object that performs the template generation.
func InitializeTemplateGenerator ¶
func InitializeTemplateGenerator(classicMode bool) (*TemplateGenerator, error)
InitializeTemplateGenerator creates a new template generator object
func (*TemplateGenerator) GenerateTemplate ¶
func (t *TemplateGenerator) GenerateTemplate(containerService *api.ContainerService) (string, string, bool, error)
GenerateTemplate generates the template from the API Model
type V20160330ContainerService ¶
type V20160330ContainerService struct { api.TypeMeta *v20160330.ContainerService }
V20160330ContainerService is the type we read and write from file needed because the json that is sent to ARM and acs-engine is different from the json that the ACS RP Api gets from ARM
type VlabsContainerService ¶
type VlabsContainerService struct { api.TypeMeta *vlabs.ContainerService }
VlabsContainerService is the type we read and write from file needed because the json that is sent to ARM and acs-engine is different from the json that the ACS RP Api gets from ARM