libvirt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package libvirt generates Machine objects for libvirt.

Package libvirt generates Machine objects for libvirt.

Index

Constants

This section is empty.

Variables

View Source
var MasterMachinesTmpl = template.Must(template.New("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: 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: libvirtproviderconfig/v1alpha1
        kind: LibvirtMachineProviderConfig
        domainMemory: 2048
        domainVcpu: 2
        ignKey: /var/lib/libvirt/images/master-{{$index}}.ign
        volume:
          poolName: default
          baseVolumeID: /var/lib/libvirt/images/coreos_base
        networkInterfaceName: {{$c.Platform.Network.Name}}
        networkInterfaceAddress: {{$c.Platform.Network.IPRange}}
        autostart: false
        uri: {{$c.Platform.URI}}
    versions:
      kubelet: ""
      controlPlane: ""
{{- end }}
`))

MasterMachinesTmpl is the template for master machines

View Source
var WorkerMachineSetTmpl = template.Must(template.New("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: worker
      sigs.k8s.io/cluster-api-cluster: {{.ClusterName}}
      sigs.k8s.io/cluster-api-machine-role: worker
      sigs.k8s.io/cluster-api-machine-type: worker
  template:
    metadata:
      labels:
        sigs.k8s.io/cluster-api-machineset: 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:
      providerConfig:
        value:
          apiVersion: libvirtproviderconfig/v1alpha1
          kind: LibvirtMachineProviderConfig
          domainMemory: 2048
          domainVcpu: 2
          ignKey: /var/lib/libvirt/images/worker.ign
          volume:
            poolName: default
            baseVolumeID: /var/lib/libvirt/images/coreos_base
          networkInterfaceName: {{.Platform.Network.Name}}
          networkInterfaceAddress: {{.Platform.Network.IPRange}}
          autostart: false
          uri: {{.Platform.URI}}
      versions:
        kubelet: ""
        controlPlane: ""
`))

WorkerMachineSetTmpl is template for worker machineset.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClusterName string
	Replicas    int64
	Platform    types.LibvirtPlatform
}

Config is used to generate the machine.

type MasterConfig

type MasterConfig struct {
	ClusterName string
	Instances   []string
	Platform    types.LibvirtPlatform
}

MasterConfig is used to generate the master machine list.

Jump to

Keyboard shortcuts

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