From 3bfd201085addeee36ed0b727d1ca7845f3a9d68 Mon Sep 17 00:00:00 2001 From: Eddie Wassef Date: Tue, 2 Jan 2024 10:39:39 -0600 Subject: [PATCH] typos --- .vscode/launch.json | 35 +++++++++++++++++++++++++ .vscode/tasks.json | 41 ++++++++++++++++++++++++++++++ gitops/gitops/testcluster/.gitkeep | 0 gitops/init.ps1 | 28 +++++++++++++++----- gitops/testcluster-host.yaml | 9 +++++++ gitops/testcluster/.gitkeep | 0 6 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 gitops/gitops/testcluster/.gitkeep create mode 100644 gitops/testcluster-host.yaml create mode 100644 gitops/testcluster/.gitkeep diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..527d638 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,35 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/operator/ClusterNetworker/ClusterNetworker/bin/Debug/net6.0/ClusterNetworker.dll", + "args": [], + "cwd": "${workspaceFolder}/operator/ClusterNetworker/ClusterNetworker", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a323b84 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/operator/ClusterNetworker/ClusterNetworker/ClusterNetworker.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/operator/ClusterNetworker/ClusterNetworker/ClusterNetworker.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/operator/ClusterNetworker/ClusterNetworker/ClusterNetworker.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/gitops/gitops/testcluster/.gitkeep b/gitops/gitops/testcluster/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/gitops/init.ps1 b/gitops/init.ps1 index 5febd03..7a1cf75 100644 --- a/gitops/init.ps1 +++ b/gitops/init.ps1 @@ -33,14 +33,28 @@ function CreateCluster { @{ role = 'control-plane' extraPortMappings = $extraPortMappings + }, + @{ + role = 'worker' + }, + @{ + role = 'worker' + }, + @{ + role = 'worker' } ) } $TempFile = New-TemporaryFile $yaml = ConvertTo-Yaml $obj | Out-File -FilePath $TempFile + if (kind get clusters | Where-Object { $_ -eq $clusterName }) { + Write-Host "Cluster $clusterName already exists" + } + else{ + kind create cluster --config $TempFile.FullName + } - kind create cluster --config $TempFile.FullName kind export kubeconfig --name $clusterName --kubeconfig=.\$clusterName.kubeconfig @@ -56,10 +70,10 @@ function CreateCluster { externalName = 'host.docker.internal' } } - $yaml = ConvertTo-Yaml $hostEntry | Out-File -FilePath .\gitops\common\$clusterName-host.yaml - New-Item -Path .\gitops\$clusterName -ItemType Directory -Force - New-Item -Path .\gitops\$clusterName\.gitkeep -ItemType File -Force - $kubeconfig = [System.IO.FileInfo]".\$clusterName.kubeconfig" + $yaml = ConvertTo-Yaml $hostEntry | Out-File -FilePath .\$clusterName-host.yaml + New-Item -Path .\$clusterName -ItemType Directory -Force + New-Item -Path .\$clusterName\.gitkeep -ItemType File -Force + $kubeconfig = [System.IO.FileInfo] "$PWD\$clusterName.kubeconfig" SetupFlux $clusterName $kubeconfig } @@ -75,7 +89,7 @@ function SetupFlux { [System.IO.FileInfo] $kubeconfig ) - + Write-Host $kubeconfig # we will install flux on the cluster using the kubeconfig passed kubectl apply -f https://github.com/fluxcd/flux2/releases/download/v0.31.5/install.yaml --kubeconfig $kubeconfig.FullName @@ -137,7 +151,7 @@ function SetupFlux { kind = 'GitRepository' name = 'common' } - path = './gitops/' + $clusterName + path = './gitops/$($clusterName)' prune = $true } } diff --git a/gitops/testcluster-host.yaml b/gitops/testcluster-host.yaml new file mode 100644 index 0000000..d571a4c --- /dev/null +++ b/gitops/testcluster-host.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: vslive + name: testcluster +spec: + type: ExternalName + externalName: host.docker.internal + diff --git a/gitops/testcluster/.gitkeep b/gitops/testcluster/.gitkeep new file mode 100644 index 0000000..e69de29