Comments (6)
The commands don’t work in Windows because:
-
There’s no implicit line wrap due to double quotes in cmd.exe, so echo fails to create a valid certificate file.
-
The backslash doesn’t work as a line wrap either in cmd.exe. Even if echo was modified to create the certificate file, using echo results in Windows line feeds which makes embedded certificates invalid and subsequent commands fail due to invalid x509 cert. It needs to be converted to use UNIX new lines before embedding and base64 encoding.
from gangway.
Would be very useful to have Windows instructions. Because most of our devs work on a windows os.
from gangway.
Additional issues:
- stdout redirection creating the CA
Suggestion:
We could have 2 info boxes (PowerShell and BASH or Windows and Mac / Linux). My preference would be to model around PowerShell vs. CMD.
I'll help work on this if it doesn't get a ton of traction.
from gangway.
This could be fixed together with #136.
Do you have a PS example? For both, installing kubectl and kubectl config?
from gangway.
Defently not perfect but this should work...
Install-Script -Name install-kubectl -Scope CurrentUser -Force
New-Item -Path 'C:\Program Files\Kubectl' -ItemType Directory
install-kubectl.ps1 -DownloadLocation 'C:\Program Files\Kubectl'
$ClusterCA = "{{ .ClusterCA }}"
Set-Content -Path ca-{{ .ClusterName }}.pem -Value $ClusterCA
kubectl config set-cluster {{ .ClusterName }} --server={{ .APIServerURL }} --certificate-authority=ca-{{ .ClusterName }}.pem --embed-certs
kubectl config set-credentials {{ .KubeCfgUser }} `
--auth-provider=oidc `
--auth-provider-arg='idp-issuer-url={{ .IssuerURL }}' `
--auth-provider-arg='client-id={{ .ClientID }}' `
--auth-provider-arg='client-secret={{ .ClientSecret }}' `
--auth-provider-arg='refresh-token={{ .RefreshToken }}' `
--auth-provider-arg='id-token={{ .IDToken }}'
kubectl config set-context {{ .ClusterName }} --cluster={{ .ClusterName }} --user={{ .KubeCfgUser }}
kubectl config use-context {{ .ClusterName }}
Remove-Item ca-{{ .ClusterName }}.pem
from gangway.
Semi-hacky but a manual alternative (if the user can't run scripts outside company):
## INSTALL KUBECTL IN POWERSHELL ##
# Create a folder ‘k’ in C:\ for kubectl.exe
New-Item -ItemType directory -Path "C:\k"
# Make the ‘k’ folder executable by adding it to your user’s $PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\k", [EnvironmentVariableTarget]::User)
# Start a new PowerShell session to see your changes take place.
# Validate that C:\k is now in your path
$env:PATH
# Download the windows kubectl client from your browser
https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/windows/amd64/kubectl.exe
# Move kubectl.exe to C:\k folder that was created in [Step 2]
The above example looks like a clean way to setup kubectl, the biggest problem was the CA cert and setting it as a var would solve that potentially.
from gangway.
Related Issues (20)
- CVEs open in v3.2.0 image HOT 8
- Multiple replicas HOT 4
- Travis build failing because of the `staticcheck` version being used. Switch to using the latest release branch. HOT 2
- Configure allowed domains in Gangway HOT 1
- Insecure TLS versions HOT 1
- [please delete]
- Google does not return refresh token without `access_type=offline` in the auth url. HOT 5
- Sanitize data from OIDC Provider
- Gangway does not display username HOT 2
- CI: Move to github actions HOT 1
- Invalid client credentials
- Collision between Kubernetes injected env variables and Gangway HOT 2
- Include UI dependencies in app HOT 1
- Generate commands for multiple k8s clusters HOT 1
- Post /dex/token: x509: certificate signed by unknown authority HOT 1
- Add support for Kustomize
- Is this project still maintained?
- Upgrading to v3.3.0? HOT 8
- Request for help on Gangway,Dex and kube-oidc-proxy manifest for cloud managed k8s cluster
- Cluster name on home page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gangway.