vizieryamls

package
v0.0.0-...-8540621 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalTemplateOptions = []*yamls.K8sTemplateOptions{
	{
		Patch:       `{"metadata": { "annotations": { "__PL_ANNOTATION_KEY__": "__PL_ANNOTATION_VALUE__"} } }`,
		Placeholder: "__PL_ANNOTATION_KEY__: __PL_ANNOTATION_VALUE__",
		TemplateValue: `{{if .Values.customAnnotations}}{{range $element := split "," .Values.customAnnotations -}}
    {{ $kv := split "=" $element -}}
    {{if eq (len $kv) 2 -}}
    {{ $kv._0 }}: "{{ $kv._1 }}"
    {{- end}}
    {{end}}{{end}}`,
	},
	{
		TemplateMatcher: yamls.TemplateScopeMatcher,
		Patch:           `{"spec": { "template": { "metadata": { "annotations": { "__PL_SPEC_ANNOTATION_KEY__": "__PL_SPEC_ANNOTATION_VALUE__"} } } } }`,
		Placeholder:     "__PL_SPEC_ANNOTATION_KEY__: __PL_SPEC_ANNOTATION_VALUE__",
		TemplateValue: `{{if .Values.customAnnotations}}{{range $element := split "," .Values.customAnnotations -}}
        {{ $kv := split "=" $element -}}
        {{if eq (len $kv) 2 -}}
        {{ $kv._0 }}: "{{ $kv._1 }}"
        {{- end}}
        {{end}}{{end}}`,
	},
	{
		Patch:       `{"metadata": { "labels": { "__PL_LABEL_KEY__": "__PL_LABEL_VALUE__"} } }`,
		Placeholder: "__PL_LABEL_KEY__: __PL_LABEL_VALUE__",
		TemplateValue: `{{if .Values.customLabels}}{{range $element := split "," .Values.customLabels -}}
    {{ $kv := split "=" $element -}}
    {{if eq (len $kv) 2 -}}
    {{ $kv._0 }}: "{{ $kv._1 }}"
    {{- end}}
    {{end}}{{end}}`,
	},
	{
		TemplateMatcher: yamls.TemplateScopeMatcher,
		Patch:           `{"spec": { "template": { "metadata": { "labels": { "__PL_SPEC_LABEL_KEY__": "__PL_SPEC_LABEL_VALUE__"} } } } }`,
		Placeholder:     "__PL_SPEC_LABEL_KEY__: __PL_SPEC_LABEL_VALUE__",
		TemplateValue: `{{if .Values.customLabels}}{{range $element := split "," .Values.customLabels -}}
        {{ $kv := split "=" $element -}}
        {{if eq (len $kv) 2 -}}
        {{ $kv._0 }}: "{{ $kv._1 }}"
        {{- end}}
        {{end}}{{end}}`,
	},
	{
		Patch:         `{"metadata": { "namespace": "__PX_NAMESPACE__" } }`,
		Placeholder:   "__PX_NAMESPACE__",
		TemplateValue: nsTmpl,
	},
	{
		TemplateMatcher: yamls.GenerateServiceAccountSubjectMatcher("default"),
		Patch:           `{ "subjects": [{ "name": "default", "namespace": "__PX_SUBJECT_NAMESPACE__", "kind": "ServiceAccount" }] }`,
		Placeholder:     "__PX_SUBJECT_NAMESPACE__",
		TemplateValue:   nsTmpl,
	},
}

GlobalTemplateOptions are template options that should be applied to each resource in the Vizier YAMLs, such as annotations and labels.

Functions

func GenerateSecretsYAML

func GenerateSecretsYAML(versionStr string) (string, error)

GenerateSecretsYAML creates the YAML for Pixie secrets.

func GenerateTemplatedDeployYAMLs

func GenerateTemplatedDeployYAMLs(yamlMap map[string]string, versionStr string) ([]*yamls.YAMLFile, error)

GenerateTemplatedDeployYAMLs generates the YAMLs that should be run when deploying Pixie using the provided YAML map.

func GenerateTemplatedDeployYAMLsWithTar

func GenerateTemplatedDeployYAMLsWithTar(tarPath string, versionStr string) ([]*yamls.YAMLFile, error)

GenerateTemplatedDeployYAMLsWithTar generates the YAMLs that should be run when deploying Pixie using the provided tar file.

func VizierTmplValuesToArgs

func VizierTmplValuesToArgs(tmplValues *VizierTmplValues) *yamls.YAMLTmplArguments

VizierTmplValuesToArgs converts the vizier template values to args which can be used to fill out a template.

Types

type VizierTmplValues

type VizierTmplValues struct {
	DeployKey                 string
	CustomDeployKeySecret     string
	CustomAnnotations         string
	CustomLabels              string
	CloudAddr                 string
	ClusterName               string
	CloudUpdateAddr           string
	UseEtcdOperator           bool
	PEMMemoryLimit            string
	PEMMemoryRequest          string
	Namespace                 string
	DisableAutoUpdate         bool
	SentryDSN                 string
	ClockConverter            string
	DataAccess                string
	DatastreamBufferSize      uint32
	DatastreamBufferSpikeSize uint32
	ElectionPeriodMs          int64
	CustomPEMFlags            map[string]string
	Registry                  string
	UseBetaPdbVersion         bool
}

VizierTmplValues are the template values that can be used to fill out templated Vizier YAMLs.

Jump to

Keyboard shortcuts

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