forked from rhdojun/simpleserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-simpleserver.sh
executable file
·30 lines (20 loc) · 1020 Bytes
/
start-simpleserver.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
#!/bin/bash
# this is a workaround until I figure out how to make use of `podman play kube`
# with the pod*yaml file
set -exuo pipefail
export runtime_dir_path=${1}
export unit_full_name=${2}
echo "cleanup possible old state"
podman stop simpleserver exportersidecar ||:
podman rm simpleserver exportersidecar ||:
podman pod rm -f simpleservertest ||:
podman pod rm -f simpleserver_pod ||:
rm -rf ${runtime_dir_path}/${unit_full_name}-pid
rm -rf ${runtime_dir_path}/${unit_full_name}-cid
echo "create the pod"
podman pod create --name simpleserver_pod -p 8080:80 -p 9117:9117
echo "create the simpleserver container in the pod"
podman run --pod=simpleserver_pod --health-interval=30s --conmon-pidfile ${runtime_dir_path}/${unit_full_name}-pid --cidfile ${runtime_dir_path}/${unit_full_name}-cid --name simpleserver -p 8080:80 -detach simpleserver:latest
echo "create the apache exporter sidecar"
podman run --pod=simpleserver_pod --name exportersidecar -p 9117:9117 -detach bitnami/apache-exporter
echo "DONE"