8000 GitHub - robszumski/node-docker-echo: Example node.js echo environment variables in docker
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

robszumski/node-docker-echo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-docker-echo

Track CPU and RAM as submitted and recorded as GET parameters.

Run with Kubernetes

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: echo
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: echo
        type: 'web'
      annotations:
        scheduler.alpha.kubernetes.io/affinity: >
          {
            "nodeAffinity": {
              "requiredDuringSchedulingIgnoredDuringExecution": {
                "nodeSelectorTerms": [
                  {
                    "matchExpressions": [
                      {
                        "key": "master",
                        "operator": "DoesNotExist"
                      }
                    ]
                  }
                ]
              }
            }
          }
    spec:
      containers:
      - name: echo
        image: quay.io/robszumski/echo-server:latest
        ports: 
        - containerPort: 3000
          name: web
          protocol: TCP
        readinessProbe:
         httpGet:
           path: /
           port: 3000
           scheme: HTTP
        livenessProbe:
         initialDelaySeconds: 10
         timeoutSeconds: 1
         httpGet:
           path: /
           port: 3000
           scheme: HTTP
        imagePullPolicy: Always

Write Values

curl http://example.com/path?cpu=100&ram=12345

Read Values

{
  "cpu":"100%",
  "ram":"12345.00"
}

About

Example node.js echo environment variables in docker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.9%
  • Dockerfile 4.1%
0