func()

in pkg/providers/tinkerbell/stack/stack.go [550:647]


func (s *Installer) createValuesOverride(bundle releasev1alpha1.TinkerbellBundle, bootEnv []string, tinkerbellIP, loadBalancerInterface, isoURL string, osiePath *url.URL) map[string]interface{} {
	valuesMap := map[string]interface{}{
		tink: map[string]interface{}{
			controller: map[string]interface{}{
				image: bundle.TinkerbellStack.Tink.TinkController.URI,
			},
			server: map[string]interface{}{
				image: bundle.TinkerbellStack.Tink.TinkServer.URI,
			},
		},
		hegel: map[string]interface{}{
			image: bundle.TinkerbellStack.Hegel.URI,
			"trustedProxies": []string{
				s.podCidrRange,
			},
		},
		smee: map[string]interface{}{
			deploy:     !s.bootsOnDocker,
			image:      bundle.TinkerbellStack.Boots.URI,
			"publicIP": tinkerbellIP,
			"trustedProxies": []string{
				s.podCidrRange,
			},
			"http": map[string]interface{}{
				"tinkServer": map[string]interface{}{
					"ip":          tinkerbellIP,
					port:          grpcPort,
					"insecureTLS": true,
				},
				"osieUrl": map[string]interface{}{
					"scheme": osiePath.Scheme,
					"host":   osiePath.Hostname(),
					"port":   osiePath.Port(),
					"path":   osiePath.Path,
				},
				"additionalKernelArgs": bootEnv,
			},
			"tinkWorkerImage": s.localRegistryURL(bundle.TinkerbellStack.Tink.TinkWorker.URI),
			"iso": map[string]interface{}{
				// it's safe to populate the URL and default to true as rufio jobs for mounting and booting
				// from iso happens only when bootmode is set to iso on tinkerbellmachinetemplate
				enabled:             true,
				"staticIPAMEnabled": true,
				"url":               isoURL,
			},
		},
		rufio: map[string]interface{}{
			image: bundle.TinkerbellStack.Rufio.URI,
			"additionalArgs": []string{
				"-metrics-bind-address=127.0.0.1:8080",
			},
		},
		stack: map[string]interface{}{
			image: bundle.TinkerbellStack.Tink.Nginx.URI,
			kubevip: map[string]interface{}{
				image:   bundle.KubeVip.URI,
				enabled: s.loadBalancer,
				additionalEnv: []map[string]string{
					{
						"name":  "prometheus_server",
						"value": ":2213",
					},
					// The Tinkerbell stack needs a load balancer to work properly.
					// We bundle Kube-vip in, as the load balancer, when we deploy the stack.
					// We don't want this load balancer to be used by any other workloads.
					// It allows us greater confidence in successful lifecycle events for the Tinkerbell stack, amongst other things.
					// Also, the user should be free from Tinkerbell stack constraints
					// and free to deploy a load balancer of their choosing and not be coupled to ours.
					// setting lb_class_only=true means that k8s services must explicitly populate
					// the kube-vip loadBalancerClass with the kube-vip value for kube-vip to serve an IP.
					{
						"name":  "lb_class_only",
						"value": "true",
					},
				},
			},
			hook: map[string]interface{}{
				enabled: false,
			},
			service: map[string]interface{}{
				enabled: s.stackService,
			},
			relay: map[string]interface{}{
				enabled:     s.dhcpRelay,
				image:       bundle.TinkerbellStack.Tink.TinkRelay.URI,
				"initImage": bundle.TinkerbellStack.Tink.TinkRelayInit.URI,
			},
			"loadBalancerIP": tinkerbellIP,
			"hostNetwork":    s.hostNetwork,
		},
	}

	if loadBalancerInterface != "" {
		valuesMap[stack].(map[string]interface{})[kubevip].(map[string]interface{})[kubevipInterface] = loadBalancerInterface
	}

	return valuesMap
}