Sign inSign up

gcosta/node-test-service

By gcosta

•Updated over 8 years ago

A NodeJS server for testing dns/routing/connectivity/etc. in your Kubernetes cluster.

Image
0

1.2K

gcosta/node-test-service repository overview

⁠Node Test Service

A NodeJS HTTP API server for testing dns/routing/connectivity/etc. in your Kubernetes cluster.

⁠Available API Endpoints
  • POST /api/log/<log_level> - 200 - causes server to write to it's log with the log level you specify via log_level param. You can also specify what message the service logs, using the msg query param.
  • GET /api/ping - 204 - health check
  • GET /api/status - 200 - returns service info
⁠Kubernetes Deployment Files
apiVersion: v1
kind: Service
metadata:
  name: test-service
  labels:
    app: test-service
  annotations:
    "prometheus.io/scrape": "true"
spec:
  type: ClusterIP
  selector:
    app: test-service
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: http
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: test-service
spec:
  revisionHistoryLimit: 5
  replicas: 1
  minReadySeconds: 30
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: test-service
      annotations:
        "prometheus.io/scrape": "true"
    spec:
      containers:
        - name: test-service
          image: "gcosta/node-test-service"
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 3000
          env:
            - name: LOG_LEVEL
              value: "*"
          livenessProbe:
            httpGet:
              path: /api/status
              port: http
            initialDelaySeconds: 10
            periodSeconds: 60
            timeoutSeconds: 5

Tag summary

Content type

Image

Digest

Size

19.5 MB

Last updated

over 8 years ago

docker pull gcosta/node-test-service