Skip to content

Instantly share code, notes, and snippets.

View SaifRehman's full-sized avatar
🎯
Focusing

SaifRehman SaifRehman

🎯
Focusing
  • IBM
  • Dubai
View GitHub Profile
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: bookingsvc
namespace: default
spec:
maxReplicas: 10
minReplicas: 1
scaleTargetRef:
apiVersion: extensions/v1beta1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: bookingsvc # give any name
spec:
replicas: 1
template:
metadata:
name: bookingsvc
labels:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: servicemesh
spec:
gateways:
- gateway
hosts:
- '*'
http:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: bookingsvc # give a service name
labels:
app: bookingsvc
spec:
type: ClusterIP
selector:
app: bookingsvc
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: bookingsvc # give any name
spec:
replicas: 1
template:
metadata:
name: bookingsvc
lifecycle:
preStop:
exec:
command: ["/bin/bash", "-c", "sleep 20"]
readinessProbe:
httpGet:
path: /healthz
port: 7000
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 2
periodSeconds: 10
livenessProbe:
httpGet:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: listingsvchpa
spec:
maxReplicas: 10
minReplicas: 2
metrics:
- type: Resource
resource: