Kubernetes/Echoserver

From Ever changing code
< Kubernetes
Revision as of 12:27, 30 September 2022 by Pio2pio (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Google echo-server deployment for testing ingress, networking access and any other related L7 communication related challenges.

Note: Below you may need to update the ingress object as it is GKE ingress implementation here.

apiVersion: apps/v1
---
apiVersion: v1
kind: Namespace
metadata:
  name: echoserver
---
kind: Deployment
metadata:
  name: echoserver
  namespace: echoserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: echoserver
  template:
    metadata:
      labels:
        app: echoserver
    spec:
      containers:
      - image: gcr.io/google_containers/echoserver:1.10
        imagePullPolicy: Always
        name: echoserver
        ports:
        - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: echoserver
  namespace: echoserver
spec:
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
  selector:
    app: echoserver
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: echoserver
  namespace: echoserver
  annotations:
    ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/8
    kubernetes.io/ingress.class: "gce-internal"
    kubernetes.io/ingress.allow-http: "true"
spec:
  defaultBackend:
    service:
      name: echoserver
      port:
        number: 80
  rules:
  - host: echo.echoserver.example.com
    http:
      paths:
      - backend:
          service:
            name: echoserver
            port:
              number: 80
        path: /
        pathType: Exact


The latest version as of writing it.

docker pull k8s.gcr.io/echoserver:1.10