Skip to content

Commit

Permalink
Fix cluter api tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
  • Loading branch information
collivier committed Nov 13, 2024
1 parent 7bfab66 commit 34d7f2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tasks/cluster_api_setup.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ task "cluster_api_setup" do |_, args|

File.write("#{clusterctl}/clusterctl.yaml", "CLUSTER_TOPOLOGY: \"true\"")

begin
KubectlClient::Create.namespace("cert-manager")
cmd = "kubectl label namespace cert-manager pod-security.kubernetes.io/enforce=privileged"
ShellCmd.run(cmd, "Label.namespace")
rescue e : KubectlClient::Create::AlreadyExistsError
Log.for("ensure_namespace_exists").info { "Kubernetes namespace cert-manager already exists for the CNF install" }
cmd = "kubectl label --overwrite namespace cert-manager pod-security.kubernetes.io/enforce=privileged"
ShellCmd.run(cmd, "Label.namespace")
end

cluster_init_cmd = "clusterctl init --infrastructure docker"
stdout = IO::Memory.new
Process.run(cluster_init_cmd, shell: true, output: stdout, error: stdout)
Expand Down

0 comments on commit 34d7f2d

Please sign in to comment.