Skip to content

Commit

Permalink
add downwardapi
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxinlee2015 committed Jun 8, 2021
1 parent f42f306 commit 6640f29
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 20 deletions.
17 changes: 17 additions & 0 deletions core/cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: game-demo
data:
# property-like keys; each key maps to a simple value
player_initial_lives: "3"
ui_properties_file_name: "user-interface.properties"

# file-like keys
game.properties: |
enemy.types=aliens,monsters
player.maximum-lives=3
user-interface.properties: |
color.good=purple
color.bad=yellow
allow.textmode=true
13 changes: 13 additions & 0 deletions core/dp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,18 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources:
limits:
memory: "128Mi"
cpu: "500m"
env:
- name: MY_spec.Nodename
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: BCS_HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
# nodeSelector:
# kubernetes.io/hostname: 9.219.90.10
16 changes: 16 additions & 0 deletions core/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-test
namespace: wessonli-test
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /todos/$2
spec:
rules:
- host: test.ingress.com
http:
paths:
- path: /t(/|$)(.*)
backend:
serviceName: svc-goserver
servicePort: 8080
19 changes: 4 additions & 15 deletions core/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@ kind: Pod
metadata:
name: my-pod
spec:
initContainers:
- name: prep-symlink
image: busybox
## command: ["bin/sh", "-ec", "ls"]
command: ["bin/sh", "-ec", "ln -s / /mnt/data/symlink-door"]
volumeMounts:
- name: my-volume
mountPath: /mnt/data
containers:
- name: my-container
image: busybox
command: ["/bin/sh", "-ec", "ls /mnt/data; sleep 999999"]
volumeMounts:
- mountPath: /mnt/data
name: my-volume
subPath: symlink-door
volumes:
- name: my-volume
emptyDir: {}
resources:
limits:
memory: "128Mi"
cpu: "500m"
2 changes: 1 addition & 1 deletion core/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
template:
metadata:
labels:
app: nginx
app: nginx-tmp
spec:
containers:
- name: nginx
Expand Down
1 change: 1 addition & 0 deletions dockerfile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ FROM centos:7
ADD ./goserver-todo /root/
RUN chmod +x /root/goserver-todo
RUN yum install -y net-tools
RUN yum install -y bind-utils
WORKDIR /root/
CMD [ "/root/goserver-todo" ]
8 changes: 4 additions & 4 deletions game/hook-inplace-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
name: test-inplace
namespace: wessonli-test
spec:
# args:
# - name: PodIP
# - name: PodName
# - name: PodNamespace
args:
- name: PodIP
- name: PodName
- name: PodNamespace
metrics:
- name: webtest
count: 30
Expand Down

0 comments on commit 6640f29

Please sign in to comment.