-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Upload file for kubeconfig is not working (add a cluster)
- Loading branch information
Showing
16 changed files
with
640 additions
and
328 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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
# Kore-board Documentation | ||
|
||
* [Developer Guide](./developer/README.md) | ||
## [Developer Guide](./developer/README.md) | ||
|
||
* [Getting started](./developer/getting-started.md) | ||
* [Architecture](./developer/architecture.md) | ||
* [API Specification](./developer/api-specification.md) | ||
* [Packaging Helm-chart](./developer/helm-chart.md) | ||
* [Web-Terminal Developer Guide](./developer/app-terminal.md) | ||
* [Getting started](./developer/getting-started.md) | ||
* [Architecture](./developer/architecture.md) | ||
* [API Specification](./developer/api-specification.md) | ||
* [Packaging Helm-chart](./developer/helm-chart.md) | ||
* [Web-Terminal Developer Guide](./developer/app-terminal.md) | ||
|
||
|
||
* [User Guide](./user/README.md) | ||
* [Installation](./user/installation.md) | ||
* [Sign-in configuration](./user/config-sign-in.md) | ||
* [Kubeconfig configuration](./user/config-kubeconfigs.md) | ||
* [Configure startup parameters](./user/config-startup-parameters.md) | ||
## [User Guide](./user/README.md) | ||
|
||
* [Installation](./user/installation.md) | ||
* [Authenticate API access with serviceaccount](./user/add-authenticate-serviceaccount.md) | ||
* Configuration | ||
* [Sign-in](./user/config-sign-in.md) | ||
* [Kubeconfig provider](./user/config-kubeconfigs.md) | ||
* [startup parameters](./user/config-startup-parameters.md) |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# User Guide | ||
|
||
* [Installation](./installation.md) | ||
* [Sign-in configuration](./config-sign-in.md) | ||
* [Kubeconfig configuration](./config-kubeconfigs.md) | ||
* [Configure startup parameters](./config-startup-parameters.md) | ||
* [Authenticate API access with serviceaccount](./add-authenticate-serviceaccount.md) | ||
* Configuration | ||
* [Sign-in](./config-sign-in.md) | ||
* [Kubeconfig provider](./config-kubeconfigs.md) | ||
* [Container startup parameters](./config-startup-parameters.md) |
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,82 @@ | ||
# Authenticate API access with serviceaccount | ||
|
||
if `client-certificate` is not available on KUBECONFIG | ||
|
||
|
||
## Prerequisites | ||
|
||
* `kubectl` and runnable | ||
|
||
## How-to | ||
|
||
* Install kore-board | ||
* See [Installation](./installation.md) page. | ||
|
||
* Create a secret for serviceaccount `kore-board` | ||
``` | ||
$ kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: kore-board-secret | ||
namespace: kore | ||
annotations: | ||
kubernetes.io/service-account.name: kore-board | ||
type: kubernetes.io/service-account-token | ||
EOF | ||
``` | ||
|
||
* Grant `cluster-admin` permission to the serviceaccount | ||
|
||
``` | ||
$ kubectl create clusterrolebinding kore-board-binding --clusterrole=cluster-admin --serviceaccount=kore:kore-board | ||
``` | ||
|
||
* Create and verify the KUBECONFIG file (ca.crt, token) | ||
|
||
``` | ||
$ echo -e "apiVersion: v1 | ||
kind: Config | ||
clusters: | ||
- cluster: | ||
certificate-authority-data: $(kubectl get secret kore-board-secret -n kore -o jsonpath='{.data.ca\.crt}') | ||
server: $(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"$(kubectl config current-context)\")].context.cluster}")\")].cluster.server}") | ||
name: token-cluster | ||
contexts: | ||
- context: | ||
cluster: token-cluster | ||
user: token-user | ||
name: admin | ||
current-context: token | ||
users: | ||
- name: token-user | ||
user: | ||
token: $(kubectl get secret kore-board-secret -n kore -o jsonpath='{.data.token}' | base64 --decode) | ||
" > kubeconfig-token.yaml | ||
$ kubectl get sa kore-board -n kore --kubeconfig="$(pwd)/kubeconfig-token.yaml" | ||
$ kubectl get secret kore-board-secret -n kore --kubeconfig="$(pwd)/kubeconfig-token.yaml" | ||
$ kubectl get nodes --kubeconfig="$(pwd)/kubeconfig-token.yaml" | ||
``` | ||
|
||
### GKE Autopilot | ||
|
||
* Configure kubconfig with `gcloud container` command | ||
|
||
``` | ||
$ export KUBECONFIG="kubeconfig-gke-autopilot.yaml" | ||
$ gcloud container clusters get-credentials autopilot-cluster-1 --region asia-northeast3 --project kore-project | ||
$ kubectl get nodes | ||
``` | ||
|
||
* Set gcloud config when edit **permission error** occurs | ||
|
||
``` | ||
ERROR: (gcloud.container.clusters.get-credentials) get-credentials requires edit permission on .... | ||
``` | ||
|
||
``` | ||
$ gcloud config set container/use_client_certificate False | ||
``` | ||
|
||
* [Authenticate API access with serviceaccount](#how-to) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
apiVersion: v2 | ||
name: kore-board | ||
type: application | ||
version: 0.5.4 | ||
appVersion: v0.5.4 | ||
version: 0.5.5 | ||
appVersion: v0.5.5 | ||
description: Kubernetes multi-clusters dashboard |
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
Binary file not shown.
Oops, something went wrong.