k8s-proxy

module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2022 License: Apache-2.0

README

k8s-proxy

How to start

  • startup k8s server with kind and copy kubeconfig to example

    kind create cluster --name=cluster1
    kind create cluster --name=cluster2
    
    $ ls example 
    cluster1 cluster2
    
  • startup k8s-proxy

    k8s-proxy --static-path=example -v=6
    
  • define kubeconfig for k8s-proxy

    apiVersion: v1
    kind: Config
    preferences: {}
    current-context: k8s-proxy
    contexts:
    - context:
        cluster: k8s-proxy
        user: k8s-proxy
      name: k8s-proxy
    clusters:
    - cluster:
        server: http://localhost:8080
      name: k8s-proxy
    users:
    - name: k8s-proxy
    
  • kubectl command

    $ KUBECONFIG=kubeconfig kubectl --server=http://localhost:8080/clusters/cluster1 get node
    NAME                     STATUS   ROLES           AGE   VERSION
    cluster1-control-plane   Ready    control-plane   11d   v1.24.0
    
    $ KUBECONFIG=kubeconfig kubectl --server=http://localhost:8080/clusters/cluster2 get node
    NAME                     STATUS   ROLES           AGE   VERSION
    cluster2-control-plane   Ready    control-plane   11d   v1.24.0
    

Directories

Path Synopsis
cmd
app
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL