Skip to content

Instantly share code, notes, and snippets.

View rinormaloku's full-sized avatar

Rinor Maloku rinormaloku

View GitHub Profile
@rinormaloku
rinormaloku / Auth.js
Last active January 13, 2019 18:36
[Configuring your tenants details in the frontend] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
const Config = {
clientID: '{YOUR_CLIENT_ID}',
domain:'{YOUR_DOMAIN}',
audience: '{YOUR_AUDIENCE}',
ingressIP: '{EXTERNAL_IP}' // Used to redirect after authentication
}
@rinormaloku
rinormaloku / App.js
Last active December 26, 2020 20:29
[Authenticating requests with Bearer Token] for the article series Intro to Istio https://rinormaloku.com/istio-an-introduction/
analyzeSentence() {
fetch('/sentiment', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${auth.getAccessToken()}` // Access Token
},
body: JSON.stringify({ sentence: this.textField.getValue() })
})
.then(response => response.json())
@rinormaloku
rinormaloku / auth-policy.yaml
Created January 13, 2019 14:58
[Authentication Policy] istio policy for the series https://rinormaloku.com/istio-an-introduction/
apiVersion: authentication.istio.io/v1alpha1
kind: Policy
metadata:
name: auth-policy
spec:
targets:
- name: sa-web-app
- name: sa-feedback
origins:
- jwt:
@rinormaloku
rinormaloku / sa-logic-retries-timeouts-vs.yaml
Created January 7, 2019 21:43
[Timeouts and Retries with VirtualServices] configuration for Introduction to Istio series https://rinormaloku.com/istio-an-introduction/ #istio
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sa-logic
spec:
hosts:
- sa-logic
http:
- route:
- destination:
@rinormaloku
rinormaloku / sa-logic-subsets-canary-vs.yaml
Created January 7, 2019 19:43
[Canary Deployments] Virtual Service configuraiton for Introduction to Istio series https://rinormaloku.com/istio-an-introduction/ #istio
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sa-logic
spec:
hosts:
- sa-logic
http:
- route:
- destination:
@rinormaloku
rinormaloku / sa-logic-subsets-shadowing-vs.yaml
Last active January 13, 2019 14:37
[VirtualService SA-Logic] routing to subset and shadowing. config for Introduction to Istio series https://rinormaloku.com/istio-an-introduction/ #istio
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sa-logic
spec:
hosts:
- sa-logic
http:
- route:
- destination:
@rinormaloku
rinormaloku / sa-logic-subsets-destinationrule.yaml
Created January 6, 2019 23:32
[Destination Rule SA-Logic] defining subsets for Introduction to Istio series https://rinormaloku.com/istio-an-introduction/ #istio
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: sa-logic
spec:
host: sa-logic # 1
subsets:
- name: v1 # 2
labels:
version: v1 # 3
@rinormaloku
rinormaloku / destinationrule-sa-frontend.yaml
Created January 6, 2019 22:58
[Destination Rule SA-Frontend] consistent hash loadbalancing for Introduction to Istio series https://rinormaloku.com/istio-an-introduction/ #istio
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: sa-frontend
spec:
host: sa-frontend
trafficPolicy:
loadBalancer:
consistentHash:
httpHeaderName: version # 1
@rinormaloku
rinormaloku / sa-virtualservice-external.yaml
Created January 5, 2019 11:14
[Virtual Services] config for the series https://rinormaloku.com/istio-an-introduction/ #istio #kubernetes
kind: VirtualService
metadata:
name: sa-external-services
spec:
hosts:
- "*"
gateways:
- http-gateway # 1
http:
- match:
@rinormaloku
rinormaloku / http-gateway.yaml
Created January 5, 2019 10:11
[Gateway] used to showcase Istio gateways for the article http://rinormaloku.com/istio-practice-gateways/
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: http-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80