forked from openservicemesh/osm
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy-tcp-client.sh
executable file
·57 lines (51 loc) · 1.25 KB
/
deploy-tcp-client.sh
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
#!/bin/bash
# This script deploys the resources corresponding to the tcp-client.
set -aueo pipefail
# shellcheck disable=SC1091
source .env
CTR_TAG="${CTR_TAG:-latest}"
KUBERNETES_NODE_ARCH="${KUBERNETES_NODE_ARCH:-amd64}"
KUBERNETES_NODE_OS="${KUBERNETES_NODE_OS:-linux}"
echo -e "Create tcp-client service account"
kubectl apply -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: tcp-client
namespace: tcp-demo
EOF
echo -e "Create tcp-client deployment"
kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: tcp-client-v1
namespace: tcp-demo
labels:
app: tcp-client
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: tcp-client
version: v1
template:
metadata:
labels:
app: tcp-client
version: v1
spec:
serviceAccountName: tcp-client
nodeSelector:
kubernetes.io/arch: ${KUBERNETES_NODE_ARCH}
kubernetes.io/os: ${KUBERNETES_NODE_OS}
containers:
- name: tcp-client
image: "${CTR_REGISTRY}/osm-demo-tcp-client:${CTR_TAG}"
imagePullPolicy: Always
command: ["/tcp-client"]
args: [ "--server-address", "tcp-echo:9000" ]
imagePullSecrets:
- name: $CTR_REGISTRY_CREDS_NAME
EOF