Skip to content

Commit

Permalink
Update the 'long running cluster' tests (istio#5895)
Browse files Browse the repository at this point in the history
* Update the helm cluster to v2

* More files for the test env

* Make script customizable
  • Loading branch information
costinm authored Jun 1, 2018
1 parent 7e0a805 commit 9745ccf
Show file tree
Hide file tree
Showing 41 changed files with 1,156 additions and 515 deletions.
62 changes: 62 additions & 0 deletions tests/helm/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#/bin/bash



function testIstioSystem() {
pushd $TOP/src/istio.io/istio
helm -n istio-system template \
--values tests/helm/values-istio-test.yaml \
--set global.refreshInterval=30s \
--set global.tag=$TAG \
--set global.hub=$HUB \
install/kubernetes/helm/istio | \
kubectl apply -n istio-system -f -
popd
}

# Install istio
function testInstall() {
make istio-demo.yaml
kubectl create ns istio-system
testIstioSystem

kubectl -n test apply -f samples/httpbin/httpbin.yaml

kubectl create ns test
kubectl label namespace test istio-injection=enabled

kubectl create ns bookinfo
kubectl label namespace bookinfo istio-injection=enabled
kubectl -n bookinfo apply -f samples/bookinfo/kube/bookinfo.yaml
}

# Apply the helm template
function testApply() {
pushd $TOP/src/istio.io/istio
helm -n test template tests/helm |kubectl -n test apply -f -
popd
}

# Setup DNS entries - currently using gcloud
# Requires DNS_PROJECT, DNS_DOMAIN and DNS_ZONE to be set
# For example, DNS_DOMAIN can be istio.example.com and DNS_ZONE istiozone.
# You need to either buy a domain from google or set the DNS to point to gcp.
# Similar scripts can setup DNS using a different provider
function testCreateDNS() {

gcloud dns --project=$DNS_PROJECT record-sets transaction start --zone=$DNS_ZONE

gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=grafana.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=prom.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=fortio2.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=pilot.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=fortio.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=fortioraw.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=bookinfo.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=httpbin.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=citadel.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE
gcloud dns --project=$DNS_PROJECT record-sets transaction add ingress08.$DNS_DOMAIN --name=mixer.v08.$DNS_DOMAIN --ttl=300 --type=CNAME --zone=$DNS_ZONE

gcloud dns --project=$DNS_PROJECT record-sets transaction execute --zone=$DNS_ZONE
}

1 change: 0 additions & 1 deletion tests/helm/templates/app-a.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Normal app, with service using targetPort different than service port.
#
apiVersion: v1
kind: Service
metadata:
Expand Down
31 changes: 1 addition & 30 deletions tests/helm/templates/app-b-headless.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
# Normal unversioned services, with a headless service
---
apiVersion: v1
kind: Service
metadata:
name: b
labels:
app: b
spec:
ports:
- port: 80
targetPort: 80
name: http
- port: 8080
targetPort: 8080
name: http-two
- port: 90
targetPort: 90
name: tcp
- port: 9090
targetPort: 9090
name: https
- port: 70
targetPort: 70
name: http2-example
- port: 7070
targetPort: 7070
name: grpc
selector:
app: b
# headless service
---
apiVersion: v1
kind: Service
Expand Down
33 changes: 0 additions & 33 deletions tests/helm/templates/app-fortio-noistio.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions tests/helm/templates/app-fortio.yaml

This file was deleted.

80 changes: 80 additions & 0 deletions tests/helm/templates/badhealth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: v1
kind: Service
metadata:
name: badhealth
labels:
app: badhealth
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: badhealth
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: badhealth
spec:
replicas: 1
template:
metadata:
labels:
app: badhealth
version: v1
spec:
containers:
- name: app
image: {{.Values.testHub}}/app:{{.Values.testTag}}
imagePullPolicy: IfNotPresent
args:
- --port
- "8080"
- --port
- "3333"
- --version
- "v1"
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /healthz
port: 3334
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 100

---
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: badlive
spec:
replicas: 1
template:
metadata:
labels:
app: badhealth
version: v1
spec:
containers:
- name: app
image: {{.Values.testHub}}/app:{{.Values.testTag}}
imagePullPolicy: IfNotPresent
args:
- --port
- "8080"
- --port
- "3333"
- --version
- "v1"
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /healthz
port: 3334
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 100
42 changes: 0 additions & 42 deletions tests/helm/templates/destination-rule-all.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions tests/helm/templates/destination-rule-c.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions tests/helm/templates/destination-rule-fqdn.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions tests/helm/templates/destination-rule-passthrough.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions tests/helm/templates/destination-rule-ssl.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions tests/helm/templates/egress-rule-httpbin.yaml

This file was deleted.

Loading

0 comments on commit 9745ccf

Please sign in to comment.