Git Product home page Git Product logo

deployment-kube-info-gatherer's Introduction

Kubernetes info-gatherer pod

Simple application meant to debug on kubernetes cluster environment Displays a table with many metadata info that helps you to understand the environment that you are at.

Getting Started

Node base application using OS module to get:

  • freemem
  • homedir
  • hostname
  • platform
  • release
  • totalmem
  • etc

And Kubernetes AWS pod API based on Metadata Service API:Status

Amazon Web Services (AWS)
http://169.254.169.254/latest/meta-data/ami-id
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html

Google Cloud
http://metadata.google.internal/computeMetadata/v1/instance/machine-type
https://cloud.google.com/compute/docs/storing-retrieving-metadata

Microsoft Azure
http://169.254.169.254/metadata/instance?api-version=2017-12-01
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service

DigitalOcean
http://169.254.169.254/metadata/v1/
https://www.digitalocean.com/docs/droplets/resources/metadata/

OpenStack
http://169.254.169.254/openstack/latest https://blogs.vmware.com/openstack/introducing-the-metadata-service/

Rancher (Kubernetes)
http://rancher-metadata/2015-07-25/ https://rancher.com/introducing-rancher-metadata-service-for-docker/

http://169.254.169.254/latest/meta-data to get:

  • ipv4
  • ami id
  • local host name
  • public host name
  • etc

Note: This application was made to Kubernetes on AWS, Even it works on a basic Docker environment, it will not be able to show all the parameters.

Using the Application

This app is stored on DOCKER HUB repository

Using it With Docker

In order to use it with docker, the container must know the docker socket, so it is mandatory that you map it with the volume.

docker run -d --name infog -p 4499:4499 -v /var/run/docker.sock:/var/run/docker.sock b4lddocker/deployment-kube-info-gatherer:latest

NOTE: If you are on Windows Docker-for-Desktop - you may whant to map like this instead.

docker run -d --name infog -p 4499:4499 -v //var/run/docker.sock:/var/run/docker.sock b4lddocker/deployment-kube-info-gatherer:latest

Using it With Kubernetes

You can pull it and use it on you deployment.yaml.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kube-infog
  # namespace: infog
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kube-infog
  template:
    metadata:
      labels:
        app: kube-infog
    spec:
      containers:
      - name: kube-infog
        image: b4lddocker/deployment-kube-info-gatherer:latest
        imagePullPolicy: Always
        ports:
          - containerPort: 4499 #Container/Application
            name: http
        volumeMounts:
        - name: dockersock
          mountPath: /var/run/docker.sock
      volumes:
      - name: dockersock
        hostPath:
          path: /var/run/docker.sock
---
apiVersion: v1
kind: Service
metadata:
  name: kube-infog-service
  # namespace: infog
  labels:
    app: kube-infog
spec:
  selector:
    app:  kube-infog
  type: NodePort
  ports:
  - name:  http
    port:    4499 #Same the Ingress/Loadbalancer
    targetPort: 4499 #Bind to container/Application
    

Or you can clone this repo and make it your own to build it.

docker build -f Dockerfile -t [ImageName]:[ImageVersion] .

Built With

  • Node.js - Base Application Framework

Contributing

Any change and pull request are welcome.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • b4ld - Initial work - b4ld

License

This project is licensed under the MIT License

Acknowledgments

  • Hat
  • Inspiration
  • l

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.