Skip to content

Commit 57fc839

Browse files
committed
Add istio
1 parent 95e94fa commit 57fc839

File tree

4 files changed

+71
-2
lines changed

4 files changed

+71
-2
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ indent_size = 4
55

66
[Makefile.*]
77
indent_style = tab
8-
indent_size = 4
8+
indent_size = 4
9+
10+
[*.yaml]
11+
indent_style = spaces
12+
indent_size = 2

deploy/ctl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ parameters:
77
description: "Config file that keeps track of the current color"
88

99
tasks:
10+
11+
# https://istio.io/docs/tasks/traffic-management/ingress/#determining-the-ingress-ip-and-ports-when-using-an-external-load-balancer
12+
ingress-host:
13+
script: |
14+
kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
15+
# https://istio.io/docs/setup/kubernetes/quick-start/
16+
istio-injection:
17+
script: |
18+
kubectl label namespace testing istio-injection=enabled
19+
1020
deps:
1121
description: "Install alpine dependencies"
1222
script: |

deploy/helmfile.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Ordered list of releases.
22
helmfiles:
3-
- "releases/app.yaml"
3+
- "releases/app.yaml"
4+
- "releases/istio.yaml"

deploy/releases/istio.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
repositories:
2+
# Cloud Posse incubator repo of helm charts
3+
- name: "kubernetes-incubator"
4+
url: "https://kubernetes-charts-incubator.storage.googleapis.com"
5+
6+
releases:
7+
#
8+
# References:
9+
# - https://github.com/helm/charts/tree/master/incubator/raw
10+
#
11+
- name: 'example-{{ requiredEnv "COLOR" }}'
12+
labels:
13+
color: "{{ requiredEnv "COLOR" }}"
14+
chart: "kubernetes-incubator/raw"
15+
version: "0.1.0"
16+
wait: true
17+
force: true
18+
recreatePods: false
19+
values:
20+
- resources:
21+
# Istio Gateway
22+
- apiVersion: networking.istio.io/v1alpha3
23+
kind: Gateway
24+
metadata:
25+
name: example-app
26+
spec:
27+
selector:
28+
# use istio default controller
29+
istio: ingressgateway
30+
servers:
31+
- port:
32+
number: 80
33+
name: http
34+
protocol: HTTP
35+
hosts:
36+
- "{{ env "APP_HOSTNAME" }}"
37+
38+
# Istio Virtual Service
39+
- apiVersion: networking.istio.io/v1alpha3
40+
kind: VirtualService
41+
metadata:
42+
name: example-app
43+
spec:
44+
hosts:
45+
- "{{ env "APP_HOSTNAME" }}"
46+
gateways:
47+
- example-app
48+
http:
49+
- route:
50+
- destination:
51+
host: example-{{ env "COLOR" }}
52+
port:
53+
number: 80
54+
weight: 100

0 commit comments

Comments
 (0)