nkia-api

npia-api

Implemented Use Cases

  1. Secured Server for both http request and web socket request (hub)

  2. Http client in Golang

Description

As this project’s unofficial name suggests, this repository tries to achieve ease of use when interacting with Kubernetes clusters
by setting up importable api endpoints that can be seamlessly called and used by executables or external libraries.

Be cautioned that those api endpoints are not the original Kubernetes api themselves, but an abstracted layer that often bundles
some of the core functions related to the original kubeapi in order to provide the users with a pseudo pipeline for managing various
Kubernetes cluster operating tasks including

  1. reading cluster node and application information (powered in part by Prometheus)

  2. writing desired lifecycle status to the cluster, which involves not only deployment but also updating, rolling-back, deletion and even
    qos management and auto-scaling

  3. building and preparing the targets of deployment (or the applications) with user-supplied info into a Kubernetes-deployable apps (thanks to Kompose)

  4. configuring and managing user-information without too much hassle on user side

Project Overview

The blueprint for the repository is as follows.

npia-api

The tree structure for the repository is as follows.

├── docs
├── go.mod
├── go.sum
├── lib
│   ├── bin
│   └── scripts
├── LICENSE
├── pkg
│   ├── apistandard
│   ├── builtinresource
│   ├── kubebase
│   ├── kuberead
│   ├── kubetoolkit
│   ├── kubewrite
│   ├── libinterface
│   ├── promquery
│   ├── runtimefs
│   └── utils
├── README.md
├── test
│   ├── kindcluster
└── var

Let me guide you through the each entrypoint briefly.

Details

This section dives into the details of each entry point.

However, it doesn’t go so deeper that you don’t have to look at the source code to understand
how everything works in conjunction.

For even more details, refer to specific comments associated with a code block, or better,
you could just run it yourself.

lib bin

Examples

lib scripts

pkg apistandard

pkg builtinresource

pkg kubebase

pkg kuberead

pkg kubetoolkit

pkg kubewrite

pkg libinterface

pkg promquery

pkg runtimefs

pkg utils