GithubHelp home page GithubHelp logo

kenv's Introduction

KENV

Lists env variables of docker image or K8s pod. By default listen on port 9090.

Building docker image

docker build -t kenv .

Or use a make command

make build

Execution

You can run either in server mode or just simply command line. In server mode HTTP server will be started.

Simple execution

python kenv.py

Execute in docker

docker run kenv

Execute in docker in server mode

docker run -p 9090:9090 kenv --server=y

Query http://localhost:9090, sample response

{
    "sysinfo": {
        "os-uname": [
            "Linux",
            "431f4d701606",
            "5.10.104-linuxkit",
            "#1 SMP PREEMPT Thu Mar 17 17:05:54 UTC 2022",
            "aarch64"
        ],
        "os-name": "posix"
    },
    "environment": {
        "PATH": "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
        "HOSTNAME": "431f4d701606",
        "LANG": "C.UTF-8",
        "GPG_KEY": "A035C8C19219BA821ECEA86B64E628F8D684696D",
        "PYTHON_VERSION": "3.10.5",
        "PYTHON_PIP_VERSION": "22.0.4",
        "PYTHON_SETUPTOOLS_VERSION": "58.1.0",
        "PYTHON_GET_PIP_URL": "https://github.com/pypa/get-pip/raw/49ca29908cfd49683da12f2d5a4fa5689539f9d9/public/get-pip.py",
        "PYTHON_GET_PIP_SHA256": "d077d469ce4c0beaf9cc97b73f8164ad20e68e0519f14dd886ce35d053721501",
        "HOME": "/root"
    }
}

Pass it to jq to get nice output

curl http://localhost:9090 | jq

K8s

Using minikube, start the cluster

minikube start

Load the image to the minikube

minikube image load kenv:latest

Apply the POD definition

kubectl apply -f pod.yml

Apply the SVC definition

kubectl apply -f service.yml

Query the service

curl 10.100.130.155:9090

kenv's People

Contributors

davidul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.