Skip to content

Commit

Permalink
add custom cert mount to coordinator jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
simisimis committed Mar 11, 2024
1 parent 6c83242 commit a3beb4b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions uptime_service_validation/coordinator/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
client.V1EnvVar(name="CASSANDRA_USE_SSL", value="1"),
client.V1EnvVar(
name="SSL_CERTFILE",
value="/root/.cassandra/sf-class2-root.crt",
value=os.environ.get("SSL_CERTFILE"),,
),
client.V1EnvVar(
name="CQLSH",
Expand Down Expand Up @@ -178,6 +178,13 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
name=entrypoint_configmap_name, default_mode=int("0777", 8)
), # 0777 permission in octal as int
)
cassandra_ssl_volume = client.V1Volume(
name="cassandra-crt",
secret=client.V1SecretVolumeSource(
secret_name="uptime-service-cassandra-crt"
),
)


# Define the volumeMounts
auth_volume_mount = client.V1VolumeMount(
Expand All @@ -189,6 +196,10 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
name="entrypoint-volume",
mount_path="/bin/entrypoint",
)
cassandra_ssl_volume_mount = client.V1VolumeMount(
name="cassandra-crt",
mount_path="/certs",
)

# Define resources for app and init container
resource_requirements_container = client.V1ResourceRequirements(
Expand All @@ -209,6 +220,7 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
volume_mounts=[
auth_volume_mount,
entrypoint_volume_mount,
cassandra_ssl_volume_mount,
],
)

Expand All @@ -224,7 +236,7 @@ def setUpValidatorPods(time_intervals, logging, worker_image, worker_tag):
containers=[container],
restart_policy="Never",
service_account_name=service_account_name,
volumes=[auth_volume, entrypoint_volume],
volumes=[auth_volume, entrypoint_volume, cassandra_ssl_volume],
)
),
),
Expand Down

0 comments on commit a3beb4b

Please sign in to comment.