File tree Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Expand file tree Collapse file tree 4 files changed +71
-3
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ KUBE_BASENAME ?= kube-
16
16
.PHONY : all master node
17
17
all : master node
18
18
19
- master : yml/kube.yml yml/$(KUBE_RUNTIME ) .yml yml/$(KUBE_RUNTIME ) -master.yml yml/$(KUBE_NETWORK ) .yml
19
+ master : yml/kube.yml yml/$(KUBE_RUNTIME ) .yml yml/$(KUBE_RUNTIME ) -master.yml yml/$(KUBE_NETWORK ) .yml $( KUBE_EXTRA_YML )
20
20
linuxkit $(LINUXKIT_ARGS ) build $(LINUXKIT_BUILD_ARGS ) -name $(KUBE_BASENAME ) master $(KUBE_FORMAT_ARGS ) $^
21
21
22
- node : yml/kube.yml yml/$(KUBE_RUNTIME ) .yml yml/$(KUBE_NETWORK ) .yml
22
+ node : yml/kube.yml yml/$(KUBE_RUNTIME ) .yml yml/$(KUBE_NETWORK ) .yml $( KUBE_EXTRA_YML )
23
23
linuxkit $(LINUXKIT_ARGS ) build $(LINUXKIT_BUILD_ARGS ) -name $(KUBE_BASENAME ) node $(KUBE_FORMAT_ARGS ) $^
24
24
25
25
yml/weave.yml : kube-weave.yaml
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export KUBE_RUNTIME=$runtime
22
22
export KUBE_NETWORK=$network
23
23
export LINUXKIT_BUILD_ARGS=" --disable-content-trust"
24
24
export KUBE_BASENAME=" ` pwd` /kube-"
25
+ export KUBE_EXTRA_YML=" ` pwd` /../test.yml"
25
26
make -C ${RT_PROJECT_ROOT} /../../ master
26
27
27
28
../test.exp ${RT_PROJECT_ROOT} /../../boot.sh ${RT_PROJECT_ROOT} /../../ssh_into_kubelet.sh
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ proc kill args {
24
24
25
25
proc boot_linuxkit {} {
26
26
global lk_sid bootexec
27
- spawn env {KUBE_RUN_ARGS=-publish 2222:22} KUBE_MEM=3584 KUBE_VCPUS=2 KUBE_DISK=8G KUBE_CLEAR_STATE=y KUBE_MASTER_UNTAINT=y $bootexec
27
+ spawn env {KUBE_RUN_ARGS=-publish 2222:22 -publish 30002:30002 } KUBE_MEM=3584 KUBE_VCPUS=2 KUBE_DISK=8G KUBE_CLEAR_STATE=y KUBE_MASTER_UNTAINT=y $bootexec
28
28
set lk_sid $spawn_id
29
29
puts "INFO lk ($lk_sid) is pid [exp_pid -i $lk_sid]"
30
30
}
@@ -195,6 +195,24 @@ await_sshcmd_output "await etcd ready" \
195
195
196
196
sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-system get -o wide pods"
197
197
198
+ sshcmd "apply app.yaml" "kubectl apply -f /root/app.yaml"
199
+
200
+ await_sshcmd_output "await nginx pod ready" \
201
+ {kubectl get pods --selector=name=nginx -o jsonpath='{.items[*].status.phase}' ; echo} \
202
+ "Running"
203
+ puts "SUCCESS application pod ready"
204
+
205
+ sshcmd "status" "kubectl get -o wide nodes ; echo ; kubectl --namespace=kube-system get -o wide pods ; echo ; kubectl --namespace=default get -o wide pods"
206
+
207
+ set curl [exec curl -sS http://localhost:30002]
208
+ if [string match "Welcome to nginx!" $curl] {
209
+ puts "FAIL nginx returned:"
210
+ puts $curl
211
+ kill ssh_sid lk_sid
212
+ exit 1
213
+ }
214
+ puts "SUCCESS nginx responded well"
215
+
198
216
kill ssh_sid
199
217
200
218
puts "RUN poweroff -f"
Original file line number Diff line number Diff line change
1
+ files :
2
+ - path : containers/services/kubelet/lower/root/app.yaml
3
+ contents : |
4
+ apiVersion: extensions/v1beta1
5
+ kind: Deployment
6
+ metadata:
7
+ name: nginx
8
+ labels:
9
+ name: nginx
10
+ namespace: default
11
+ spec:
12
+ replicas: 1
13
+ template:
14
+ metadata:
15
+ labels:
16
+ name: nginx
17
+ spec:
18
+ containers:
19
+ - name: nginx
20
+ image: nginx:alpine
21
+ ports:
22
+ - name: www
23
+ containerPort: 80
24
+ volumeMounts:
25
+ - mountPath: /tmp
26
+ name: tmp-volume
27
+ volumes:
28
+ - name: tmp-volume
29
+ emptyDir:
30
+ medium: Memory
31
+ nodeSelector:
32
+ beta.kubernetes.io/os: linux
33
+ ---
34
+ apiVersion: v1
35
+ kind: Service
36
+ metadata:
37
+ name: nginx
38
+ labels:
39
+ name: nginx
40
+ namespace: default
41
+ spec:
42
+ type: NodePort
43
+ ports:
44
+ # the port that this service should serve on
45
+ - port: 80
46
+ targetPort: 80
47
+ nodePort: 30002
48
+ selector:
49
+ name: nginx
You can’t perform that action at this time.
0 commit comments