Adding config application process to generation
This commit is contained in:
parent
b06d9ad39e
commit
427047c39c
1 changed files with 14 additions and 2 deletions
|
|
@ -71,11 +71,23 @@ resource "null_resource" "talos_cluster" {
|
||||||
sudo --preserve-env=HOME talosctl cluster create \
|
sudo --preserve-env=HOME talosctl cluster create \
|
||||||
--provisioner=qemu \
|
--provisioner=qemu \
|
||||||
--name ${self.triggers.cluster_name} \
|
--name ${self.triggers.cluster_name} \
|
||||||
--talosconfig ${path.module}/config/talosconfig \
|
|
||||||
--controlplanes 1 \
|
--controlplanes 1 \
|
||||||
--workers 0 \
|
--workers 0 \
|
||||||
--memory ${self.triggers.memory_mb} \
|
--memory ${self.triggers.memory_mb} \
|
||||||
--cpus ${self.triggers.vcpu_count}
|
--cpus ${self.triggers.vcpu_count} \
|
||||||
|
--skip-kubeconfig
|
||||||
|
|
||||||
|
# Apply our pre-generated configuration
|
||||||
|
echo "Applying Talos configuration..."
|
||||||
|
talosctl apply-config --insecure --nodes 10.5.0.2 --file configs/controlplane.yaml
|
||||||
|
|
||||||
|
# Bootstrap the cluster using our pre-generated talosconfig
|
||||||
|
echo "Bootstrapping cluster..."
|
||||||
|
talosctl --talosconfig configs/talosconfig bootstrap --nodes 10.5.0.2
|
||||||
|
|
||||||
|
# Get kubeconfig
|
||||||
|
echo "Generating kubeconfig..."
|
||||||
|
talosctl --talosconfig configs/talosconfig kubeconfig --nodes 10.5.0.2
|
||||||
|
|
||||||
# Change ownership of the generated files in ~/.talos and ~/.kube
|
# Change ownership of the generated files in ~/.talos and ~/.kube
|
||||||
sudo chown -R $(id -u):$(id -g) $HOME/.talos
|
sudo chown -R $(id -u):$(id -g) $HOME/.talos
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue