Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stack/docs/quickstarts/KUBERNETES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You will need to bring your own hardware (machine) for this guide.
trusted_proxies=$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ',')
LB_IP=<specify a Load balancer IP>
STACK_CHART_VERSION=0.6.2
helm install tink-stack oci://ghcr.io/tinkerbell/charts/stack --version "$STACK_CHART_VERSION" --create-namespace --namespace tink --wait --set "global.trustedProxies={${trusted_proxies}}" --set "global.publicIP=$LB_IP"
helm install tink-stack oci://ghcr.io/tinkerbell/charts/stack --version "$STACK_CHART_VERSION" --create-namespace --namespace tink --wait --set "global.trustedProxies={${trusted_proxies}}" --set "global.publicIP=$LB_IP"
```

> These instructions above should be checked against the Charts repo before using. See the [README.md](https://github.com/tinkerbell/charts/tree/main/tinkerbell/stack) in the Helm chart repository for more information on how to use the Helm chart.
Expand Down
13 changes: 7 additions & 6 deletions stack/vagrant/.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
LIBVIRT_HOST_IP=192.168.56.1
PROVISIONER_IP=192.168.56.4
LOADBALANCER_IP=192.168.56.5
LOADBALANCER_IP=192.168.56.40
LOADBALANCER_IP_2=192.168.56.41
MACHINE1_IP=192.168.56.43
MACHINE1_MAC=08:00:27:9e:f5:3a

# https://github.com/tinkerbell/charts/pkgs/container/charts%2Fstack
HELM_CHART_VERSION=0.4.5
KUBECTL_VERSION=1.30.4
K3D_VERSION=v5.7.3
HELM_VERSION=v3.15.4
# https://github.com/tinkerbell/tinkerbell/pkgs/container/charts%2Ftinkerbell
HELM_CHART_VERSION=v0.17.1-a4609e2a
KUBECTL_VERSION=1.32.4
K3D_VERSION=v5.8.3
HELM_VERSION=v3.17.0
7 changes: 4 additions & 3 deletions stack/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ open(".env", "r").readlines.each {

LIBVIRT_HOST_IP = ENV["LIBVIRT_HOST_IP"] || "192.168.56.1"
PROVISIONER_IP = ENV["PROVISIONER_IP"] || "192.168.56.4"
LOADBALANCER_IP = ENV["LOADBALANCER_IP"] || "192.168.56.4"
LOADBALANCER_IP = ENV["LOADBALANCER_IP"] || "192.168.56.40"
LOADBALANCER_IP_2 = ENV["LOADBALANCER_IP_2"] || "192.168.56.41"
GATEWAY_IP = ENV["GATEWAY_IP"] || ""
MACHINE1_IP = ENV["MACHINE1_IP"] || "192.168.56.43"
MACHINE1_MAC = (ENV["MACHINE1_MAC"] || "08:00:27:9E:F5:3A").downcase
HELM_CHART_VERSION = ENV["HELM_CHART_VERSION"] || "0.4.0"
HELM_CHART_VERSION = ENV["HELM_CHART_VERSION"] || "0.17.0"
KUBECTL_VERSION = ENV["KUBECTL_VERSION"] || "1.28.3"
K3D_VERSION = ENV["K3D_VERSION"] || "v5.6.0"
HELM_VERSION = ENV["HELM_VERSION"] || "v3.14.4"
Expand Down Expand Up @@ -47,7 +48,7 @@ Vagrant.configure("2") do |config|
override.vm.synced_folder "", DEST_DIR_BASE, type: "rsync"
end

stack.vm.provision :shell, path: "setup.sh", args: [PROVISIONER_IP, MACHINE1_IP, MACHINE1_MAC, DEST_DIR_BASE, LOADBALANCER_IP, HELM_CHART_VERSION, HELM_LOADBALANCER_INTERFACE, KUBECTL_VERSION, K3D_VERSION, HELM_VERSION, GATEWAY_IP]
stack.vm.provision :shell, path: "setup.sh", args: [PROVISIONER_IP, MACHINE1_IP, MACHINE1_MAC, DEST_DIR_BASE, LOADBALANCER_IP, HELM_CHART_VERSION, HELM_LOADBALANCER_INTERFACE, KUBECTL_VERSION, K3D_VERSION, HELM_VERSION, LOADBALANCER_IP_2, GATEWAY_IP]
end

config.vm.define :machine1, autostart: false do |machine1|
Expand Down
31 changes: 17 additions & 14 deletions stack/vagrant/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,27 @@ kubectl_for_vagrant_user() {
}

helm_install_tink_stack() {
local namespace=$1
local version=$2
local interface=$3
local loadbalancer_ip=$4
local namespace="$1"
local version="$2"
local interface="$3"
local loadbalancer_ip="$4"
local loadbalancer_ip_2="$5"

trusted_proxies=""
until [ "$trusted_proxies" != "" ]; do
trusted_proxies=$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ',')
sleep 5
done
helm install tink-stack oci://ghcr.io/tinkerbell/charts/stack \
helm install tink-stack oci://ghcr.io/tinkerbell/charts/tinkerbell \
--version "$version" \
--create-namespace \
--namespace "$namespace" \
--wait \
--set "smee.trustedProxies={${trusted_proxies}}" \
--set "hegel.trustedProxies={${trusted_proxies}}" \
--set "stack.kubevip.interface=$interface" \
--set "stack.relay.sourceInterface=$interface" \
--set "stack.loadBalancerIP=$loadbalancer_ip" \
--set "smee.publicIP=$loadbalancer_ip"
--set "trustedProxies={${trusted_proxies}}" \
--set "publicIP=$loadbalancer_ip" \
--set "artifactsFileServer=http://$loadbalancer_ip_2:8080" \
--set "deployment.init.sourceInterface=$interface" \
--set "kubevip.interface=$interface"
}

apply_manifests() {
Expand Down Expand Up @@ -121,13 +121,14 @@ run_helm() {
local k3d_version=$8
local namespace="tink-system"
local helm_version=$9
local loadbalancer_ip_2="${10}"

install_k3d "$k3d_version"
start_k3d
kubectl_for_vagrant_user
install_helm "$helm_version"
helm_install_tink_stack "$namespace" "$helm_chart_version" "$loadbalancer_interface" "$loadbalancer_ip"
apply_manifests "$worker_ip" "$worker_mac" "$manifests_dir" "$loadbalancer_ip" "$namespace"
helm_install_tink_stack "$namespace" "$helm_chart_version" "$loadbalancer_interface" "$loadbalancer_ip" "$loadbalancer_ip_2"
apply_manifests "$worker_ip" "$worker_mac" "$manifests_dir" "$loadbalancer_ip_2" "$namespace"
}

main() {
Expand All @@ -141,14 +142,16 @@ main() {
local kubectl_version="$8"
local k3d_version="$9"
local helm_version="${10}"
local loadbalancer_ip_2="${11}"
local gateway_ip="${12}"

update_apt
install_docker
# https://github.com/ipxe/ipxe/pull/863
# Needed after iPXE increased the default TCP window size to 2MB.
sudo ethtool -K eth1 tx off sg off tso off
install_kubectl "$kubectl_version"
run_helm "$host_ip" "$worker_ip" "$worker_mac" "$manifests_dir" "$loadbalancer_ip" "$helm_chart_version" "$loadbalancer_interface" "$k3d_version" "$helm_version"
run_helm "$host_ip" "$worker_ip" "$worker_mac" "$manifests_dir" "$loadbalancer_ip" "$helm_chart_version" "$loadbalancer_interface" "$k3d_version" "$helm_version" "$loadbalancer_ip_2"
}

if [[ ${BASH_SOURCE[0]} == "$0" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion stack/vagrant/ubuntu-download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
volumes:
- name: hook-artifacts
hostPath:
path: /opt/hook
path: /tmp
type: DirectoryOrCreate
- name: configmap-volume
configMap:
Expand Down