/
deploy_testrunner.go
63 lines (58 loc) · 1009 Bytes
/
deploy_testrunner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package testutils
import (
"context"
"k8s.io/client-go/rest"
)
func DeployTestRunner(ctx context.Context, cfg *rest.Config, namespace string) error {
return DeployFromYaml(ctx, cfg, namespace, TestRunnerYaml)
}
const TestRunnerYaml = `
apiVersion: v1
kind: Pod
metadata:
labels:
gloo: testrunner
name: testrunner
spec:
containers:
- image: soloio/testrunner:testing-8671e8b9
imagePullPolicy: IfNotPresent
command:
- sleep
- "36000"
name: testrunner
restartPolicy: Always`
const NginxYaml = `
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
ports:
- port: 80
name: http
selector:
app: nginx
`