Skip to content

Files

Latest commit

309d8a3 · Mar 6, 2025

History

History

swiftkubedash

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 27, 2021
May 27, 2021
Nov 15, 2020
Feb 23, 2025
Mar 6, 2025
Nov 15, 2020
Nov 15, 2020
Mar 6, 2025
Nov 15, 2020
Mar 6, 2025
Jan 29, 2023
Nov 15, 2020

SwiftkubeDash

Mac + Linux

Overview

A miny example dashboard using SwiftkubeClient on Vapor.

Screenshots

Deployments Deployment Pods Pod Logs Create

Usage

ℹ️ The app tries to determine the kubeconfig automatically so a valid config should be available at the correct location.

ℹ️ The following permissions are required:

  • List and Get deployments in all namespaces
  • List and Get pods in all namespaces
  • Create Resources in all namespaces

To try this just clone this repository and then depending on the environment:

$ git clone https://github.com/swiftkube/examples
$ cd examples/swiftkubedash

Locally

If you want to run this locally, then just build the project and start the executable:

$ swift build
$ .build/debug/Run serve --env production --hostname 0.0.0.0 --port 8080

A valid kubeconfig file should exist in your $HOME/.kube/config, which will be picked up and used by the app.

Docker & Docker Compose

Build the docker image and run it. You can mount a valid kubeconfig into the running container via a volume mount. For example, you can mount your local config like this:

$ docker build . -t <image>
$ docker run -v $HOME/.kube/config:/app/.kube/config -p 8080:8080 <image> 

Kubernetes

You can deploy the docker image in Kubernetes. The app will configure itself with the mounted service-account and namespace.

⚠️ Review the manifests before applying random stuff into your cluster.

You can apply the manifests in the deploy folder:

⚠️ If you deploy in any namespace other than default, then you have to change the subject's namespace in the ClusterRoleBinding

kubectl apply -f ./deploy

This will create a deployment, configured with a service-account and a cluster-role, and a service of type ClusterIP. You can access it like usual, e.g. a public ingress, port-forward .. etc.