diff --git a/deploy/istio/canary-dep.yaml b/deploy/istio/canary-dep.yaml new file mode 100644 index 0000000..a9dd500 --- /dev/null +++ b/deploy/istio/canary-dep.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: podinfo-canary + labels: + app: podinfo + release: canary +spec: + replicas: 2 + selector: + matchLabels: + app: podinfo + release: canary + template: + metadata: + labels: + app: podinfo + release: canary + annotations: + prometheus.io/scrape: 'true' + spec: + containers: + - name: podinfod + image: quay.io/stefanprodan/podinfo:0.2.2 + imagePullPolicy: Always + command: + - ./podinfo + - -port=9898 + - -debug=true + ports: + - name: http + containerPort: 9898 + protocol: TCP + readinessProbe: + httpGet: + path: /readyz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 5 + failureThreshold: 1 + livenessProbe: + httpGet: + path: /healthz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 10 + failureThreshold: 2 + resources: + requests: + memory: "32Mi" + cpu: "10m" diff --git a/deploy/istio/canary-routes.yaml b/deploy/istio/canary-routes.yaml new file mode 100644 index 0000000..4de86e8 --- /dev/null +++ b/deploy/istio/canary-routes.yaml @@ -0,0 +1,22 @@ +apiVersion: config.istio.io/v1alpha2 +kind: RouteRule +metadata: + name: podinfo-canary + namespace: default +spec: + precedence: 2 + match: + request: + headers: + x-user: + regex: .*insider.* +# exact: insider + destination: + name: podinfo + route: + - labels: + release: canary + weight: 50 + - labels: + release: canaryb + weight: 50 diff --git a/deploy/istio/canaryb-dep.yaml b/deploy/istio/canaryb-dep.yaml new file mode 100644 index 0000000..f6152d7 --- /dev/null +++ b/deploy/istio/canaryb-dep.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: podinfo-canaryb + labels: + app: podinfo + release: canaryb +spec: + replicas: 2 + selector: + matchLabels: + app: podinfo + release: canaryb + template: + metadata: + labels: + app: podinfo + release: canaryb + annotations: + prometheus.io/scrape: 'true' + spec: + containers: + - name: podinfod + image: quay.io/stefanprodan/podinfo:0.2.0 + imagePullPolicy: Always + command: + - ./podinfo + - -port=9898 + - -debug=true + ports: + - name: http + containerPort: 9898 + protocol: TCP + readinessProbe: + httpGet: + path: /readyz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 5 + failureThreshold: 1 + livenessProbe: + httpGet: + path: /healthz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 10 + failureThreshold: 2 + resources: + requests: + memory: "32Mi" + cpu: "10m" diff --git a/deploy/istio/ga-dep.yaml b/deploy/istio/ga-dep.yaml new file mode 100644 index 0000000..2b2f984 --- /dev/null +++ b/deploy/istio/ga-dep.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: podinfo-ga + labels: + app: podinfo + release: ga +spec: + replicas: 2 + selector: + matchLabels: + app: podinfo + release: ga + template: + metadata: + labels: + app: podinfo + release: ga + annotations: + prometheus.io/scrape: 'true' + spec: + containers: + - name: podinfod + image: quay.io/stefanprodan/podinfo:0.2.1 + imagePullPolicy: Always + command: + - ./podinfo + - -port=9898 + - -debug=true + ports: + - name: http + containerPort: 9898 + protocol: TCP + readinessProbe: + httpGet: + path: /readyz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 5 + failureThreshold: 1 + livenessProbe: + httpGet: + path: /healthz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 10 + failureThreshold: 2 + resources: + requests: + memory: "32Mi" + cpu: "10m" diff --git a/deploy/istio/ga-routes.yaml b/deploy/istio/ga-routes.yaml new file mode 100644 index 0000000..4e317ea --- /dev/null +++ b/deploy/istio/ga-routes.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: config.istio.io/v1alpha2 +kind: RouteRule +metadata: + name: podinfo-ga + namespace: default +spec: + match: + request: + headers: + x-user: + regex: .* + destination: + name: podinfo + route: + - labels: + release: ga + weight: 100 diff --git a/deploy/istio/podinfo-gateway.yaml b/deploy/istio/podinfo-gateway.yaml new file mode 100644 index 0000000..174fb78 --- /dev/null +++ b/deploy/istio/podinfo-gateway.yaml @@ -0,0 +1,57 @@ +#--- +#apiVersion: networking.istio.io/v1alpha3 +#kind: Gateway +#metadata: +# name: podinfo-gateway +#spec: +# selector: +# app: podinfo +# servers: +# - port: +# number: 9898 +# name: http +# hosts: +# - podinfo.test +#--- +#apiVersion: networking.istio.io/v1alpha3 +#kind: VirtualService +#metadata: +# name: podinfo +#spec: +# hosts: +# - podinfo +# http: +# - match: +# - headers: +# x-user: +# exact: insider +# route: +# - destination: +# name: podinfo-canary +# subset: canary +# - route: +# - destination: +# name: podinfo-ga +# subset: ga +#--- +#apiVersion: networking.istio.io/v1alpha3 +#kind: DestinationRule +#metadata: +# name: podinfo-ga +#spec: +# name: podinfo-ga +# subsets: +# - name: ga +# labels: +# release: ga +#--- +#apiVersion: networking.istio.io/v1alpha3 +#kind: DestinationRule +#metadata: +# name: podinfo-canary +#spec: +# name: podinfo-canary +# subsets: +# - name: canary +# labels: +# release: canary diff --git a/deploy/istio/podinfo-ing.yaml b/deploy/istio/podinfo-ing.yaml new file mode 100644 index 0000000..523a0bd --- /dev/null +++ b/deploy/istio/podinfo-ing.yaml @@ -0,0 +1,15 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: podinfo + annotations: + kubernetes.io/ingress.class: istio +spec: + rules: + - host: podinfo.test + http: + paths: + - path: /.* + backend: + serviceName: podinfo + servicePort: 9898 diff --git a/deploy/istio/podinfo-svc.yaml b/deploy/istio/podinfo-svc.yaml new file mode 100644 index 0000000..833dba0 --- /dev/null +++ b/deploy/istio/podinfo-svc.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: podinfo + labels: + app: podinfo +spec: + type: NodePort + ports: + - name: http + port: 9898 + targetPort: http + protocol: TCP + selector: + app: podinfo