-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from BornToBeRoot/feature/kubectl
Add kubernetes kubectl
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Function Get-KubernetesKubectl { | ||
<# | ||
.SYNOPSIS | ||
Returns the available Kubernetes Kubectl versions. | ||
.NOTES | ||
Author: BornToBeRoot | ||
Twitter: @_BornToBeRoot | ||
#> | ||
[OutputType([System.Management.Automation.PSObject])] | ||
[CmdletBinding(SupportsShouldProcess = $False)] | ||
param ( | ||
[Parameter(Mandatory = $False, Position = 0)] | ||
[ValidateNotNull()] | ||
[System.Management.Automation.PSObject] | ||
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) | ||
) | ||
|
||
# Get the latest version for kubectl | ||
$Version = Invoke-RestMethod -Uri $res.Get.Update.Uri | ||
|
||
# Build the download links for each platform & architecture | ||
foreach ($DownloadUri in $res.Get.Download.Uri.GetEnumerator()) { | ||
[pscustomobject] @{ | ||
Version = $Version | ||
Architecture = $DownloadUri.Name.Split("_")[1] | ||
Platform = $DownloadUri.Name.Split("_")[0] | ||
URI = $DownloadUri.Value -replace $res.Get.Download.ReplaceVersionText, $Version | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"Name": "Kubernetes Kubectl", | ||
"Source": "https://kubernetes.io/", | ||
"Get": { | ||
"Update": { | ||
"Uri": "https://cdn.dl.k8s.io/release/stable.txt" | ||
}, | ||
"Download": { | ||
"Uri": { | ||
"Windows_x64": "https://dl.k8s.io/release/#version/bin/windows/amd64/kubectl.exe", | ||
"Windows_x86": "https://dl.k8s.io/release/#version/bin/windows/386/kubectl.exe", | ||
"Windows_arm64": "https://dl.k8s.io/release/#version/bin/windows/arm64/kubectl.exe", | ||
"Linux_x64": "https://dl.k8s.io/release/#version/bin/linux/amd64/kubectl", | ||
"Linux_arm64": "https://dl.k8s.io/release/#version/bin/linux/arm64/kubectl", | ||
"Darwin_x64": "https://dl.k8s.io/release/#version/bin/darwin/amd64/kubectl", | ||
"Darwin_arm64": "https://dl.k8s.io/release/#version/bin/darwin/arm64/kubectl" | ||
}, | ||
"ReplaceVersionText": "#version" | ||
} | ||
}, | ||
"Install": { | ||
"Setup": { | ||
"Windows": "kubectl.exe", | ||
"Linux" : "kubectl", | ||
"Darwin" : "kubectl" | ||
}, | ||
"Physical": { | ||
"Arguments": "", | ||
"PostInstall": [] | ||
}, | ||
"Virtual": { | ||
"Arguments": "", | ||
"PostInstall": [] | ||
} | ||
} | ||
} |