Skip to content

Instantly share code, notes, and snippets.

View pavan-kumar-99's full-sized avatar

Pavan Kumar pavan-kumar-99

View GitHub Profile
@pavan-kumar-99
pavan-kumar-99 / deployment.yaml
Created July 23, 2020 18:49
The vault annotations that should be added to the Pod Spec
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.deployment.name }}
name: {{ .Values.deployment.name }}
spec:
replicas: {{ .Values.deployment.replicas }}
selector:
@pavan-kumar-99
pavan-kumar-99 / podv1.yaml
Created July 24, 2020 07:56
This is the pod spec file for version:v1
apiVersion: v1
kind: Pod
metadata:
labels:
app: httpd
version: v1
name: httpd-v1
namespace: default
spec:
containers:
@pavan-kumar-99
pavan-kumar-99 / virtual-service.yaml
Created July 24, 2020 10:23
This contains the virtual service and destination rules for the web-service
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: web-virtualservice
spec:
hosts:
- web-service.default.svc.cluster.local
http:
- route:
- destination:
apiVersion: v1
kind: Pod
metadata:
labels:
app: httpd
version: v2
name: httpd-v2
namespace: default
spec:
containers:
@pavan-kumar-99
pavan-kumar-99 / web-service.yaml
Created July 24, 2020 10:57
Web Service to expose both the versions of pods
apiVersion: v1
kind: Service
metadata:
labels:
app: web-service
name: web-service
spec:
ports:
- name: http-port
port: 80
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: web-mirror-vs
spec:
hosts:
- web-service.default.svc.cluster.local
http:
- route:
- destination:
apiVersion: "security.istio.io/v1beta1"
kind: "PeerAuthentication"
metadata:
name: mtls-only-policy
namespace: default
spec:
mtls:
mode: STRICT
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: web-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
name: web-service
namespace: default
spec:
hosts:
- "*"
gateways:
- web-gateway
#The namespace in which all the components should be installed
namespace: kustomize-demo
#The order in which the Kubernetes resources should be installed
resources:
- ns.yaml
- deployment.yaml
- svc.yaml