openstack

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package openstack generates Machine objects for openstack.

Package openstack generates Machine objects for openstack.

Index

Constants

This section is empty.

Variables

View Source
var MasterMachinesTmpl = template.Must(template.New("openstack-master-machines").Parse(`
{{- $c := . -}}
kind: List
apiVersion: v1
metadata:
  resourceVersion: ""
  selfLink: ""
items:
{{- range $index,$instance := .Instances}}
- apiVersion: cluster.k8s.io/v1alpha1
  kind: Machine
  metadata:
    name: {{$c.ClusterName}}-master-{{$index}}
    namespace: openshift-cluster-api
    labels:
      sigs.k8s.io/cluster-api-cluster: {{$c.ClusterName}}
      sigs.k8s.io/cluster-api-machine-role: master
      sigs.k8s.io/cluster-api-machine-type: master
  spec:
    providerSpec:
      value:
        apiVersion: openstack.cluster.k8s.io/v1alpha1
        kind: OpenStackMachineProviderConfig
        cloudName: {{$c.CloudName}}
        cloudsSecret: "openstack-credentials"
        image: {{$c.Image}}
        flavor: {{$c.Machine.FlavorName}}
        placement:
          region: {{$c.Region}}
        networks:
{{- range $key,$value := $c.Tags}}
        - filter:
            tags: "{{$key}}={{$value}}"
{{- end}}
        securityGroups:
          - master
        userDataSecret:
          name: master-user-data
        trunk: {{$c.Trunk}}
    versions:
      kubelet: "v1.11.0"
      controlPlane: ""
{{- end -}}
`))

MasterMachinesTmpl is the template for master machines.

View Source
var WorkerMachineSetTmpl = template.Must(template.New("openstack-worker-machineset").Parse(`
apiVersion: cluster.k8s.io/v1alpha1
kind: MachineSet
metadata:
  name: {{.ClusterName}}-worker
  namespace: openshift-cluster-api
  labels:
    sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
    sigs.k8s.io/cluster-api-machine-role: worker
    sigs.k8s.io/cluster-api-machine-type: worker
spec:
  replicas: {{.Replicas}}
  selector:
    matchLabels:
      sigs.k8s.io/cluster-api-machineset: {{.ClusterName}}-worker
      sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
  template:
    metadata:
      labels:
        sigs.k8s.io/cluster-api-machineset: {{.ClusterName}}-worker
        sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
        sigs.k8s.io/cluster-api-machine-role: worker
        sigs.k8s.io/cluster-api-machine-type: worker
    spec:
      providerSpec:
        value:
          apiVersion: openstack.cluster.k8s.io/v1alpha1
          kind: OpenStackMachineProviderConfig
          cloudName: {{.CloudName}}
          cloudsSecret: "openstack-credentials"
          image: {{.Image}}
          flavor: {{.Machine.FlavorName}}
          placement:
            region: {{.Region}}
          networks:
{{- range $key,$value := .Tags}}
          - filter:
              tags: "{{$key}}={{$value}}"
{{- end}}
          securityGroups:
            - worker
          userDataSecret:
            name: worker-user-data
          trunk: {{.Trunk}}
      versions:
        kubelet: "v1.11.0"
        controlPlane: ""
`))

WorkerMachineSetTmpl is template for worker machineset.

Functions

This section is empty.

Types

type Config

type Config struct {
	CloudName   string
	ClusterName string
	Replicas    int64
	Image       string
	Tags        map[string]string
	Region      string
	Machine     openstack.MachinePool
	Trunk       bool
}

Config is used to generate the machine.

type MasterConfig

type MasterConfig struct {
	CloudName   string
	ClusterName string
	Instances   []string
	Image       string
	Tags        map[string]string
	Region      string
	Machine     openstack.MachinePool
	Trunk       bool
}

MasterConfig is used to generate the machine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL