Skip to content

Commit

Permalink
Fix issue with namespace creation when setting up System Upgrade Cont…
Browse files Browse the repository at this point in the history
…roller
  • Loading branch information
vitobotta committed Apr 12, 2024
1 parent 9cc12b7 commit ee88d21
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/kubernetes/installer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,8 @@ class Kubernetes::Installer
private def deploy_system_upgrade_controller
puts "\nDeploying k3s System Upgrade Controller..."

command = "kubectl create ns system-upgrade && kubectl annotate ns kubectl.kubernetes.io/last-applied-configuration=true"

result = Util::Shell.run(command, configuration.kubeconfig_path, settings.hetzner_token)

unless result.success?
puts "Failed to deploy k3s System Upgrade Controller:"
puts result.output
exit 1
end

command = "kubectl apply -f #{settings.system_upgrade_controller_config_manifest_url},#{settings.system_upgrade_controller_crd_manifest_url}"
# Run second manifest twice to fix problem with namespace creation
command = "kubectl apply -f #{settings.system_upgrade_controller_config_manifest_url},#{settings.system_upgrade_controller_crd_manifest_url},#{settings.system_upgrade_controller_crd_manifest_url}"

result = Util::Shell.run(command, configuration.kubeconfig_path, settings.hetzner_token)

Expand Down

0 comments on commit ee88d21

Please sign in to comment.