File tree 3 files changed +20
-4
lines changed
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,20 @@ That's it!
30
30
At the end of the ` terraform apply ` , a ` kubeconfig ` file is generated
31
31
in this directory. To use your new cluster, you can do:
32
32
33
+ Linux
33
34
``` bash
34
35
export KUBECONFIG=$PWD /kubeconfig
35
36
kubectl get nodes
36
37
```
37
38
39
+
40
+ Windows
41
+ ``` powershell
42
+ $env:KUBECONFIG="$pwd\kubeconfig"
43
+ kubectl get nodes
44
+ ```
45
+
46
+
38
47
The command above should show you 4 nodes, named ` node1 ` to ` node4 ` .
39
48
40
49
You can also log into the VMs. At the end of the Terraform output
Original file line number Diff line number Diff line change 3
3
}
4
4
locals {
5
5
bash = " while ! curl -k https://${ oci_core_instance . _[1 ]. public_ip } :6443; do sleep 1; done"
6
- powershell = " powershell -file .\\ winInsecureCurl.ps1"
6
+ powershell = " powershell .\\ winInsecureCurl.ps1 ${ oci_core_instance . _[ 1 ] . public_ip } "
7
7
}
8
8
9
9
resource "null_resource" "wait_for_kube_apiserver" {
@@ -18,8 +18,7 @@ data "external" "kubeconfig" {
18
18
program = local. is_windows ? [
19
19
" powershell" ,
20
20
<< EOT
21
- $Content1 = ssh -o StrictHostKeyChecking=no -l k8s -i ${ local_file . ssh_private_key . filename } ${ oci_core_instance . _[1 ]. public_ip } sudo base64 -w0 /etc/kubernetes/admin.conf
22
- write-host "{`"base64`": `"$($Content1)`"}"
21
+ write-host "{`"base64`": `"$(ssh -o StrictHostKeyChecking=no -l k8s -i ${ local_file . ssh_private_key . filename } ${ oci_core_instance . _[1 ]. public_ip } sudo base64 -w0 /etc/kubernetes/admin.conf)`"}"
23
22
EOT
24
23
] : [
25
24
" sh" ,
Original file line number Diff line number Diff line change
1
+ param (
2
+ [Parameter ()]
3
+ [String ]$address
4
+ )
5
+ $url = " https://$ ( $address ) :6443"
6
+
1
7
add-type @"
2
8
using System.Net;
3
9
using System.Security.Cryptography.X509Certificates;
@@ -10,4 +16,6 @@ add-type @"
10
16
}
11
17
"@
12
18
[System.Net.ServicePointManager ]::CertificatePolicy = New-Object TrustAllCertsPolicy
13
- while ( -not (Invoke-WebRequest - uri https:// ${oci_core_instance._[1].public_ip} :6443 )){ Start-Sleep 1 }
19
+ Start-Sleep - Seconds 5
20
+ while ( -not (Invoke-WebRequest $url )){ Start-Sleep - Seconds 1 }
21
+ Start-Sleep - Seconds 5
You can’t perform that action at this time.
0 commit comments