templates

package
v3.0.8-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Manifest = template.Must(template.New("Spec").Parse(
	dedent.Dedent(`
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Manifest
metadata:
  name: {{ .Options.Name }}
spec:
  arches:
  {{- range .Options.Arches }}
  - {{ . }}
  {{- end }}
  operatingSystems:
  {{- range $i, $v := .Options.OperatingSystems }}
  - arch: {{ $v.Arch }}
    type: {{ $v.Type }}
    id: {{ $v.Id }}
    version: "{{ $v.Version }}"
    osImage: {{ $v.OsImage }}
    repository:
      iso:
        localPath: 
        url: 
  {{- end }}
  kubernetesDistributions:
  {{- range $i, $v := .Options.KubernetesDistributions }}
  - type: {{ $v.Type }}
    version: {{ $v.Version }}
  {{- end}}
  components:
    helm: 
      version: {{ .Options.Components.Helm.Version }}
    cni: 
      version: {{ .Options.Components.CNI.Version }}
    etcd: 
      version: {{ .Options.Components.ETCD.Version }}
    containerRuntimes:
    {{- range $i, $v := .Options.Components.ContainerRuntimes }}
    - type: {{ $v.Type }}
      version: {{ $v.Version }}
    {{- end}}
    crictl: 
      version: {{ .Options.Components.Crictl.Version }}
    ## 
    # docker-registry:
    #   version: "2"
    # harbor:
    #   version: v2.4.1
    # docker-compose:
    #   version: v2.2.2
  images:
  {{- range .Options.Images }}
  - {{ . }}
  {{- end }}
  registry:
    auths: {}

    `)))

Manifest defines the template of manifest file.

Functions

func RenderManifest

func RenderManifest(opt *Options) (string, error)

Types

type Options

type Options struct {
	Name                    string
	Arches                  []string
	OperatingSystems        []kubekeyv1alpha2.OperatingSystem
	KubernetesDistributions []kubekeyv1alpha2.KubernetesDistribution
	Components              kubekeyv1alpha2.Components
	Images                  []string
}

Jump to

Keyboard shortcuts

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