Skip to content

Instantly share code, notes, and snippets.

@harsh4870
Created April 19, 2022 09:13
Show Gist options
  • Save harsh4870/18390cd3259b29c43bfbb945a3c9be29 to your computer and use it in GitHub Desktop.
Save harsh4870/18390cd3259b29c43bfbb945a3c9be29 to your computer and use it in GitHub Desktop.
Kubernetes print request, body & header details into logs going into service
apiVersion: apps/v1
kind: Deployment
metadata:
name: istio-echoserver
spec:
replicas: 1
selector:
matchLabels:
app: istio-echoserver
template:
metadata:
labels:
app: istio-echoserver
spec:
containers:
- image: gcr.io/google_containers/echoserver:1.0
imagePullPolicy: Always
name: istio-echoserver
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: istio-echoserver
spec:
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: istio-echoserver
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-echoserver
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: istio-echoserver
spec:
hosts:
- "*"
gateways:
- istio-echoserver
http:
- match:
- uri:
prefix: /http-eacho
route:
- destination:
host: istio-echoserver
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment