Skip to content

Commit 37996c3

Browse files
committed
Add the HTTPS port to a Docker container support
1 parent 8b26779 commit 37996c3

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

docs/RUNNING_AS_DOCKER_CONTAINER.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ IMPORTANT The IBM Spectrum Scale system must run 5.0.5.2 or above.
1919
```
2020

2121

22+
2223
### On the host running docker/podman perform the following steps:
2324

25+
2426
1. Clone this repository using git in your favourite directory
2527

2628
```shell
@@ -55,5 +57,27 @@ cp grafana_bridge/source/gpfsConfig
5557

5658
```
5759

58-
5960
Now you can add the host running the bridge container to the Grafana monitoring Datasource list.
61+
62+
63+
64+
### Using HTTPS(SSL) connection for the IBM Spectrum Scale Performance Monitoring Bridge running in a container
65+
66+
67+
1. Follow the instructions [How to setup HTTPS(SSL)](./SETUP_SSL_CONNECTION.md) to generate a private key and certificate for
68+
69+
2. Start the bridge running in a container:
70+
71+
```shell
72+
# podman run -dt -p 4242:4242,8443:8443 -e "SERVER=9.XXX.XXX.XXX" -e "PORT=8443" -e "KEYPATH=/opt/registry/certs" \ -v /tmp:/opt/IBM/bridge/logs -v /opt/registry/certs:/opt/registry/certs \ --pod new:my-bridge-ssl-test-pod --name bridge-ssl-test bridge_ssl_test:grafana
73+
74+
# podman logs bridge-ssl-test
75+
Connection to the collector server established successfully
76+
Successfully retrieved MetaData
77+
Received sensors:
78+
79+
CPU DiskFree GPFSFilesystem GPFSFilesystemAPI GPFSNSDDisk GPFSNSDFS GPFSNSDPool GPFSNode GPFSNodeAPI GPFSRPCS GPFSVFS GPFSWaiters Load Memory Netstat Network GPFSDiskCap GPFSFileset GPFSFilesetQuota GPFSInodeCap GPFSPool GPFSPoolCap
80+
Initial cherryPy server engine start have been invoked. Python version: 3.6.8 (default, Dec 5 2019, 15:45:45)
81+
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)], cherryPy version: 18.6.0.
82+
server started
83+
```

docs/SETUP_SSL_CONNECTION.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ Note: If you are using python3, please check which cherryPy version is compatibl
2929
4. Start the bridge listening on the socket port 8443. Don't forget to provide the location of ‘privkey.pem’ and ‘cert.pem’ (-k option), otherwise you will get the error message:
3030

3131
```shell
32-
# python zimonGrafanaIntf.py -p 8443
32+
# python3 zimonGrafanaIntf.py -p 8443 -k /opt/registry/certs
3333
```
34+
35+
36+
#### Read more about HTTPS(SSL) connection
37+
[CherryPy openSSL documentation](https://docs.cherrypy.org/en/latest/deploy.html#ssl-support)

source/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ COPY ./gpfsConfig/mmsdrfs* /var/mmfs/gen/
1919
COPY ./gpfsConfig/ZIMon* /opt/IBM/zimon/
2020

2121

22+
ARG HTTPPORT=4242
23+
ENV PORT=$HTTPPORT
24+
RUN echo "the HTTP/S port is set to $PORT"
25+
26+
ARG CERTPATH
27+
ENV KEYPATH=$CERTPATH
28+
RUN if [ -z "$KEYPATH" ] && [ "$PORT" -eq 8443 ]; then echo "KEYPATH FOR SSL CONNECTION NOT SET - ERROR"; exit 1; else echo "PASS"; fi
29+
RUN echo "the ssl certificates path is set to $KEYPATH"
2230

2331
ARG PMCOLLECTORIP=0.0.0.0
2432
ENV SERVER=$PMCOLLECTORIP
@@ -36,9 +44,11 @@ RUN echo "$(pwd)"
3644
RUN touch $LOGPATH
3745
RUN echo "log path: $(dirname $LOGPATH)" >> $LOGPATH
3846
RUN echo "pmcollector_server: $SERVER" >> $LOGPATH
47+
RUN echo "ssl certificates location: $KEYPATH" >> $LOGPATH
48+
RUN echo "HTTP/S port: $PORT" >> $LOGPATH
3949

40-
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER"]
50+
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER -p $PORT -k $KEYPATH"]
4151

42-
EXPOSE 4242
52+
EXPOSE 4242 8443
4353

4454
#CMD ["tail", "-f", "/dev/null"]

0 commit comments

Comments
 (0)