Custom proxy image registry, repo and version

Use the --registry, --repository and --image_version options of
`kamal proxy boot_config set` to change the kamal-proxy image used.

We'll still insist that the image version is at least as high as the
minimum.
This commit is contained in:
Donal McBreen
2025-04-16 16:01:34 +01:00
parent c9a755bde6
commit 85320dbc51
13 changed files with 197 additions and 40 deletions

View File

@@ -1,3 +1,6 @@
#!/bin/sh
set -e
kamal proxy boot_config set --registry registry:4443
echo "Deployed!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-deploy

View File

@@ -41,4 +41,4 @@ accessories:
interval: 1
timeout: 1
path: "/"
drain_timeout: 2

View File

@@ -1,3 +1,6 @@
#!/bin/sh
set -e
kamal proxy boot_config set --registry registry:4443
echo "Deployed!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-deploy

View File

@@ -1,4 +1,7 @@
kamal proxy boot_config set --publish false \
set -e
kamal proxy boot_config set --registry registry:4443 \
--publish false \
--docker_options label=traefik.http.services.kamal_proxy.loadbalancer.server.scheme=http \
label=traefik.http.routers.kamal_proxy.rule=PathPrefix\(\`/\`\) \
sysctl=net.ipv4.ip_local_port_range=\"10000\ 60999\"

View File

@@ -20,6 +20,7 @@ push_image_to_registry_4443() {
install_kamal
push_image_to_registry_4443 nginx 1-alpine-slim
push_image_to_registry_4443 busybox 1.36.0
push_image_to_registry_4443 basecamp/kamal-proxy v0.8.7
# .ssh is on a shared volume that persists between runs. Clean it up as the
# churn of temporary vm IPs can eventually create conflicts.

View File

@@ -12,11 +12,11 @@ class IntegrationTest < ActiveSupport::TestCase
teardown do
unless passed?
[ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container|
puts
puts "Logs for #{container}:"
docker_compose :logs, container
end
# [ :deployer, :vm1, :vm2, :shared, :load_balancer, :registry ].each do |container|
# puts
# puts "Logs for #{container}:"
# docker_compose :logs, container
# end
end
docker_compose "down -t 1"
end

View File

@@ -6,6 +6,8 @@ class ProxyTest < IntegrationTest
end
test "boot, reboot, stop, start, restart, logs, remove" do
kamal :proxy, :boot_config, :set, "--registry", "registry:4443"
kamal :proxy, :boot
assert_proxy_running
@@ -46,7 +48,7 @@ class ProxyTest < IntegrationTest
logs = kamal :proxy, :logs, capture: true
assert_match /No previous state to restore/, logs
kamal :proxy, :boot_config, :set, "--docker-options='sysctl net.ipv4.ip_local_port_range=\"10000 60999\"'"
kamal :proxy, :boot_config, :set, "--registry", "registry:4443", "--docker-options='sysctl net.ipv4.ip_local_port_range=\"10000 60999\"'"
assert_docker_options_in_file
kamal :proxy, :reboot, "-y"