-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZDM-295 Enhance docker-compose components #5
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NETWORK_SUBNET=192.168.100.0/24 |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,56 +7,60 @@ networks: | |
ipam: | ||
driver: default | ||
config: | ||
- subnet: 192.168.100.0/24 | ||
- subnet: $NETWORK_SUBNET | ||
|
||
services: | ||
origin: | ||
image: cassandra:3.11 | ||
restart: unless-stopped | ||
environment: | ||
- CASSANDRA_CLUSTER_NAME='origin_cluster' | ||
- CASSANDRA_NUM_TOKENS=32 | ||
- CASSANDRA_DC=datacenter1 | ||
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch | ||
networks: | ||
proxy: | ||
|
||
target: | ||
image: cassandra:4.0 | ||
restart: unless-stopped | ||
environment: | ||
- CASSANDRA_CLUSTER_NAME='target_cluster' | ||
- CASSANDRA_DC=datacenter1 | ||
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch | ||
networks: | ||
proxy: | ||
|
||
proxy: | ||
image: thesoul/ubuntu-dind:docker-20.10.12 | ||
build: ./docker-compose/services/proxy | ||
restart: unless-stopped | ||
tty: true | ||
privileged: true | ||
volumes: | ||
- .:/opt/zdm-proxy-automation | ||
- ./compose/keys:/run/keys | ||
entrypoint: | ||
- /opt/zdm-proxy-automation/compose/proxy-entrypoint.sh | ||
- ./docker-compose/services/proxy/proxy-entrypoint.sh:/usr/bin/proxy-entrypoint.sh | ||
- ./docker-compose/share:/run/zdm-proxy-automation/ | ||
networks: | ||
proxy: | ||
deploy: | ||
mode: replicated | ||
replicas: 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main goal for the docker-compose infrastructure was testing the automation in an environment as similar as possible to the real production environment, meaning distribute machines/VMs running multiple proxy instances/replicas. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries. Reverted the change and moved the number of replicas to the .env file as suggested. |
||
|
||
jumphost: | ||
image: ubuntu:20.04 | ||
build: ./docker-compose/services/jumphost | ||
restart: unless-stopped | ||
tty: true | ||
environment: | ||
- CIDR_IP_SUBNET=$NETWORK_SUBNET | ||
volumes: | ||
- .:/opt/zdm-proxy-automation | ||
- ./compose/keys:/run/keys | ||
entrypoint: | ||
- /opt/zdm-proxy-automation/compose/jumphost-entrypoint.sh | ||
- ./docker-compose/services/jumphost/jumphost-entrypoint.sh:/usr/bin/jumphost-entrypoint.sh | ||
- ./docker-compose/share:/run/zdm-proxy-automation/ | ||
- ./ansible/:/opt/zdm-proxy-automation/ansible/ | ||
networks: | ||
proxy: | ||
|
||
client: | ||
image: ubuntu:20.04 | ||
build: ./docker-compose/services/client | ||
restart: unless-stopped | ||
tty: true | ||
volumes: | ||
- .:/opt/zdm-proxy-automation | ||
entrypoint: | ||
- /opt/zdm-proxy-automation/compose/client-entrypoint.sh | ||
- ./docker-compose/services/client/client-entrypoint.sh:/usr/bin/client-entrypoint.sh | ||
- ./docker-compose/share:/run/zdm-proxy-automation/ | ||
networks: | ||
proxy: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV ZDM_PROXY_RUN /run/zdm-proxy-automation | ||
ENV HOSTS_FILE ${ZDM_PROXY_RUN}/hostsfile | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get -y install \ | ||
iproute2 \ | ||
net-tools \ | ||
iputils-ping \ | ||
python3 \ | ||
python3-pip \ | ||
tzdata | ||
|
||
RUN python3 -m pip install -U cqlsh | ||
|
||
# Fix timezone in client | ||
RUN ln -fs /usr/share/zoneinfo/Australia/Sydney /etc/localtime && \ | ||
dpkg-reconfigure -f noninteractive tzdata | ||
|
||
ENTRYPOINT ["client-entrypoint.sh"] | ||
CMD [""] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! I liked this approach to build the image on the fly and then re-use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 😄