openstack

package
v0.7.0-master Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 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:
    providerConfig:
      value:
        apiVersion: openstack.cluster.k8s.io/v1alpha1
        kind: OpenStackMachineProviderConfig
        image:
          id: {{$c.Image}}
        flavor: {{$c.Machine.FlavorName}}
        placement:
          region: {{$c.Region}}
        subnet:
          filters:
          - name: "tag:Name"
            values:
            - "{{$c.ClusterName}}-master-*"
        tags:
{{- range $key,$value := $c.Tags}}
          - name: "{{$key}}"
            value: "{{$value}}"
{{- end}}
        securityGroups:
          - filters:
            - name: "tag:Name"
              values:
              - "{{$c.ClusterName}}_master_sg"
        userDataSecret:
          name: master-user-data
    versions:
      kubelet: ""
      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-0
  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-0
      sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
  template:
    metadata:
      labels:
        sigs.k8s.io/cluster-api-machineset: {{.ClusterName}}-worker-0
        sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
        sigs.k8s.io/cluster-api-machine-role: worker
        sigs.k8s.io/cluster-api-machine-type: worker
    spec:
      providerConfig:
        value:
          apiVersion: openstack.cluster.k8s.io/v1alpha1
          kind: OpenStackMachineProviderConfig
          image:
            id: {{.Image}}
          flavor: {{.Machine.FlavorName}}
          placement:
            region: {{.Region}}
          subnet:
            filters:
            - name: "tag:Name"
              values:
              - "{{.ClusterName}}-worker-*"
          tags:
{{- range $key,$value := .Tags}}
            - name: "{{$key}}"
              value: "{{$value}}"
{{- end}}
          securityGroups:
            - filters:
              - name: "tag:Name"
                values:
                - "{{.ClusterName}}_worker_sg"
          userDataSecret:
            name: worker-user-data
      versions:
        kubelet: ""
        controlPlane: ""
`))

WorkerMachineSetTmpl is template for worker machineset.

Functions

This section is empty.

Types

type Config

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

Config is used to generate the machine.

type MasterConfig

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

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