templates

package
v3.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 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 }}
  {{- if not .Options.OperatingSystems }}
  operatingSystems: []
  {{- else }}
  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 }}
  {{- 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}}
    calicoctl:
      version: {{ .Options.Components.Calicoctl.Version }}
    crictl: 
      version: {{ .Options.Components.Crictl.Version }}
    {{ if .Options.Components.DockerRegistry.Version -}}
    docker-registry:
      version: "{{ .Options.Components.DockerRegistry.Version }}"
    harbor:
      version: {{ .Options.Components.Harbor.Version }}
    docker-compose:
      version: {{ .Options.Components.DockerCompose.Version }}
	{{- end }}
  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