diff --git a/patchfox_playground.tf.j2 b/patchfox_playground.tf.j2 index fbe5942..d6c5e13 100644 --- a/patchfox_playground.tf.j2 +++ b/patchfox_playground.tf.j2 @@ -26,34 +26,35 @@ resource "coder_app" "adminer" { sub_path = "dev" read_only = false } - - volume_mount { - mount_path = "/mnt/pgdata" - name = "home" - sub_path = "pgdata" - read_only = false - } {% endblock %} {% block additional_containers %} container { - name = "postgres" - image = "postgres:17" + name = "dind" + image = "docker:dind" image_pull_policy = "{{ image_pull_policy }}" - env { - name = "POSTGRES_PASSWORD" - value = "postgres" + security_context { + privileged = true + run_as_user = 0 } + command = [ + "dockerd", + "--host=tcp://0.0.0.0:2375", + "--host=unix:///var/run/docker.sock", + "--mtu=1450", + "--registry-mirror=http://docker-cache.cicd.svc.cluster.local:5000" + ] + env { - name = "PGDATA" - value = "/var/lib/postgresql/data/pgdata" + name = "DOCKER_HOST" + value = "tcp://localhost:2375" } resources { requests = { - "cpu" = "250m" + "cpu" = "500m" "memory" = "512Mi" } limits = { @@ -63,107 +64,10 @@ resource "coder_app" "adminer" { } volume_mount { - mount_path = "/var/lib/postgresql/data" + mount_path = "/var/lib/docker" name = "home" - sub_path = "pgdata" + sub_path = "docker" read_only = false } } - - container { - name = "adminer" - image = "adminer" - image_pull_policy = "{{ image_pull_policy }}" - - resources { - requests = { - "cpu" = "250m" - "memory" = "512Mi" - } - limits = { - "cpu" = "250m" - "memory" = "512Mi" - } - } - } - - container { - name = "zookeeper" - image = "confluentinc/cp-zookeeper" - image_pull_policy = "{{ image_pull_policy }}" - - env { - name = "ZOOKEEPER_CLIENT_PORT" - value = "2181" - } - - env { - name = "ZOOKEEPER_ADMIN_ENABLE_SERVER" - value = "false" - } - - env { - name = "ZOOKEEPER_TICK_TIME" - value = "2000" - } - - resources { - requests = { - "cpu" = "250m" - "memory" = "512Mi" - } - limits = { - "cpu" = "250m" - "memory" = "512Mi" - } - } - } - - container { - name = "kafka" - image = "confluentinc/cp-kafka" - image_pull_policy = "{{ image_pull_policy }}" - - env { - name = "KAFKA_BROKER_ID" - value = "1" - } - - env { - name = "KAFKA_ZOOKEEPER_CONNECT" - value = "localhost:2181" - } - - env { - name = "KAFKA_ADVERTISED_LISTENERS" - value = "PLAINTEXT://localhost:9092" - } - - env { - name = "KAFKA_LISTENER_SECURITY_PROTOCOL_MAP" - value = "PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT" - } - - env { - name = "KAFKA_INTER_BROKER_LISTENER_NAME" - value = "PLAINTEXT" - } - - env { - name = "KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR" - value = "1" - } - - - resources { - requests = { - "cpu" = "250m" - "memory" = "512Mi" - } - limits = { - "cpu" = "250m" - "memory" = "512Mi" - } - } - } {% endblock %} \ No newline at end of file