Skip to content

nishants/podfx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pod File Explorer

Build Status

Idea

By using kubectl/API we can create a GUI app that can :

  • view all cluster configured on my system
  • select a cluster
  • view all pods
  • choose a pod
  • open file system
  • browse files
  • download files
  • upload files

Components

  • GUI-CORE a react app that can be used inside a shell (e.g. electron, vs-code webframe)
  • NODE-API : an npm module that can connect with kubectl/K8s API to execute command and return results. can be used in any mode env (e.g. electron, vs-code extension)
  • APP : An electron app

Todo

  • detect all cluster in local kubectl config

  • connect to a cluster

  • list namespaces in a cluster

  • list pods in a cluster

  • get containers on a pod

  • run kubectul exec in a node program

  • run exec with file streams

  • run exec with custom streams

  • test spike with a cluster on AKS

  • test spike on a with oauth protected ap

    Did not pickup auth token from kubeconfig.

    Need to check this.

  • create ui interactions with mocks

  • download a file

  • upload a file

How to parse console outptuts and map it to a command ?

  • Every output will end with a # on cli.
  • For every command, append it with # so we can ignore echoed command
  • when reading output, ignore all lines with a # at end

Contracts:

  • loadKubeContext(path = null)

    • Get kubernetes configuration from the path

    • if path is null, read default kubeconfig file

    • Sets the kube config in current lib.

    • returns list of clusters and path:

      {
      	kubeContext : {
      		name: "/path/to/kubeconfig"
      	},
      	clusters: [
      		{name: ""},
          {name: ""},
          {name: ""},
      	]
      }
  • getNameSpaces(kubeContextPath, clusterName)

    • Get list of namespaces in kubernetes cluster using the context file

    • The context should be already loaded in memory

    • returns list of names spaces

      {
      	kubeContext : {name: "/path/to/kubeconfig"},
      	cluster: {name: "clusterName"}
      	namespaces: [
      		{name: ""},
          {name: ""},
          {name: ""},
      	]
      }
  • getPods(kubeContextPath, clusterName, namespace)

    • get pods in namespace

      {
      	kubeContext : {name: "/path/to/kubeconfig"},
      	cluster: {name: "clusterName"},
        namespace: {name: "namespace"},
      	pods: [
      		{name: ""},
          {name: ""},
          {name: ""},
      	]
      }
  • getContainers(kubeContextPath, clusterName, namespace, podName)

    • get containers in pods

      {
      	kubeContext : {name: "/path/to/kubeconfig"},
      	cluster: {name: "clusterName"},
        namespace: {name: "namespace"},
        pod: {name: "podName"},
      	containers: [
      		{name: ""},
          {name: ""},
          {name: ""},
      	]
      }
  • GetFiles(kubeContextPath, clusterName, namespace, podName, containerName, path)

    • Get files in the path

      {
      	kubeContext : {name: "/path/to/kubeconfig"},
      	cluster: {name: "clusterName"},
        namespace: {name: "namespace"},
        pod: {name: "podName"},
      	container: {name: "contaierName"},
      	path: "/path/to/dir",
      	contents: [
      		{name: "app", type: "file", created: "23/02/2021"},
          {name: "lib", type: "dir" , created: "23/02/2021"},
      	]
      }
window.appShell.apiClient.loadContext().then(console.log)

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published