Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go.work.sum

# env file
.env
deploy/.kube/

# Editor/IDE
# .vscode/
Expand Down
73 changes: 40 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ endif
COMPOSE_FILE := deploy/compose.yaml
COMPOSE_PROJECT_NAME ?= control-plane
COMPOSE_NETWORK := $(COMPOSE_PROJECT_NAME)_default
UTILITIES_DIR ?= ../utilities
KIND_SCRIPTS_DIR ?= $(UTILITIES_DIR)/scripts/kind
COMPOSE_SCRIPTS_DIR ?= $(UTILITIES_DIR)/scripts/compose
KUBEVIRT_SCRIPTS_DIR ?= $(UTILITIES_DIR)/scripts/kubevirt
COMPOSE_NETWORKS ?= deploy_default $(COMPOSE_NETWORK)
PROFILES ?= providers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PROFILES is unused after dropping compose-up-with-providers. I think you can remove this


COMPOSE ?= $(shell command -v podman-compose >/dev/null 2>&1 && echo podman-compose || \
Expand Down Expand Up @@ -53,38 +58,38 @@ run-dev:
compose-up:
$(COMPOSE) -f $(COMPOSE_FILE) up -d --build

# Platform stack with optional service providers (see deploy/RUN.md).
compose-up-with-providers:
$(COMPOSE) -f $(COMPOSE_FILE) --profile $(PROFILES) up -d --build
Comment thread
qodo-code-review[bot] marked this conversation as resolved.

# Tear down the compose stack. Kind (or other externals) joined to the compose
# network block "compose down" from removing it — disconnect them first.
# Network cleanup uses podman- or docker-specific commands (not portable flags).
compose-down:
@for network in deploy_default $(COMPOSE_NETWORK); do \
if [ "$(CONTAINER_ENGINE)" = podman ]; then \
if podman network exists "$$network" 2>/dev/null; then \
for c in $$(podman ps -a --filter network=$$network -q 2>/dev/null); do \
podman network disconnect -f "$$network" "$$c" 2>/dev/null || true; \
done; \
fi; \
elif [ "$(CONTAINER_ENGINE)" = docker ]; then \
if docker network inspect "$$network" >/dev/null 2>&1; then \
for c in $$(docker ps -a --filter network=$$network -q 2>/dev/null); do \
docker network disconnect "$$network" "$$c" --force 2>/dev/null || true; \
done; \
fi; \
fi; \
done; \
COMPOSE_PROJECT_NAME=deploy $(COMPOSE) -f $(COMPOSE_FILE) down -v --remove-orphans 2>/dev/null || true; \
# Platform stack + environment-agent profile (see deploy/RUN.md).
compose-up-with-agent:
$(COMPOSE) -f $(COMPOSE_FILE) --profile environment-agent up -d --build

# Local dev helpers (scripts in dcm-project/utilities — see deploy/docs/environment-agent-kind.md).
install-kubevirt:
bash $(KUBEVIRT_SCRIPTS_DIR)/install-kubevirt.sh

kubeconfig-for-compose:
DEPLOY_ROOT="$(CURDIR)" bash $(KIND_SCRIPTS_DIR)/kubeconfig-for-compose.sh

kind-connect:
COMPOSE_NETWORK=$(COMPOSE_NETWORK) CONTAINER_ENGINE=$(CONTAINER_ENGINE) \
bash $(KIND_SCRIPTS_DIR)/kind-connect.sh

kind-disconnect:
@COMPOSE_NETWORK=$(COMPOSE_NETWORK) CONTAINER_ENGINE=$(CONTAINER_ENGINE) \
bash $(KIND_SCRIPTS_DIR)/kind-disconnect.sh || true

disconnect-compose-networks:
@COMPOSE_NETWORKS="$(COMPOSE_NETWORKS)" CONTAINER_ENGINE=$(CONTAINER_ENGINE) \
bash $(COMPOSE_SCRIPTS_DIR)/network-teardown.sh disconnect || true

remove-compose-networks:
@COMPOSE_NETWORKS="$(COMPOSE_NETWORKS)" CONTAINER_ENGINE=$(CONTAINER_ENGINE) \
bash $(COMPOSE_SCRIPTS_DIR)/network-teardown.sh remove || true

# Tear down the compose stack. Disconnect Kind and other externals first so networks can be removed.
compose-down: kind-disconnect disconnect-compose-networks
@COMPOSE_PROJECT_NAME=deploy $(COMPOSE) -f $(COMPOSE_FILE) down -v --remove-orphans 2>/dev/null || true; \
$(COMPOSE) -f $(COMPOSE_FILE) down -v --remove-orphans; \
for network in deploy_default $(COMPOSE_NETWORK); do \
if [ "$(CONTAINER_ENGINE)" = podman ]; then \
podman network rm -f "$$network" 2>/dev/null || true; \
elif [ "$(CONTAINER_ENGINE)" = docker ]; then \
docker network rm "$$network" 2>/dev/null || true; \
fi; \
done
$(MAKE) remove-compose-networks

image-build:
$(CONTAINER_ENGINE) build -f Containerfile -t $(CONTAINER_IMAGE_NAME):$(CONTAINER_IMAGE_TAG) .
Expand Down Expand Up @@ -112,6 +117,8 @@ test:
tidy:
go mod tidy

.PHONY: build run run-dev compose-up compose-up-with-providers compose-down image-build \
clean fmt vet lint test test-catalog test-placement test-policy test-sp tidy \
.PHONY: build run run-dev compose-up compose-up-with-agent compose-down \
install-kubevirt kubeconfig-for-compose kind-connect kind-disconnect \
disconnect-compose-networks remove-compose-networks \
image-build clean fmt vet lint test test-catalog test-placement test-policy test-sp tidy \
helm-chart-sync helm-chart-verify-sync helm-chart-verify-admin-subject helm-chart-verify helm-chart-verify-schema helm-chart-lint helm-chart-template helm-chart-check
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ in shared-workflows for tag behavior and version conventions.

Full-stack Compose and Helm packaging live under `deploy/`:

- **Compose:** control-plane, postgres, nats, keycloak, dcm-ui, and optional service providers
- **Compose:** control-plane, postgres, nats, keycloak, dcm-ui, and optional environment-agent profile
- **Helm:** Kubernetes/OpenShift chart at `deploy/helm/dcm` (optional auth via `auth.enabled`)

See [deploy/RUN.md](deploy/RUN.md) for local stack usage, authentication, and service provider profiles.
See [deploy/RUN.md](deploy/RUN.md) for local stack usage, authentication, and the environment-agent profile.
See [deploy/helm/dcm/README.md](deploy/helm/dcm/README.md) for cluster installs.

Authentication is disabled by default (`AUTH_DISABLED=true`). The CLI forwards
Expand Down
49 changes: 17 additions & 32 deletions deploy/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Optional: copy to .env in the repo root and set for local overrides.
# Optional: copy to deploy/.env for local overrides (loaded by deploy/compose.yaml).
# Used by deploy/compose.yaml. Defaults (admin / adminpass) are for local dev only.
# POSTGRES_USER=admin
# POSTGRES_PASSWORD=adminpass
Expand All @@ -15,32 +15,21 @@
# KEYCLOAK_ADMIN_PASSWORD=admin
# DCM_DEV_USER_PASSWORD=admin

# K8s container service provider (profile: k8s-container)
# K8S_CONTAINER_SP_KUBECONFIG=/path/to/kubeconfig
# K8S_CONTAINER_SP_NAMESPACE=default
# K8S_CONTAINER_SP_NAME=k8s-container-provider
# K8S_CONTAINER_SP_EXTERNAL_SVC_TYPE=NodePort

# K8s storage service provider (profile: storage)
# K8S_STORAGE_SP_KUBECONFIG=/path/to/kubeconfig
# K8S_STORAGE_SP_NAMESPACE=default
# K8S_STORAGE_SP_NAME=k8s-storage-provider
# K8S_STORAGE_SP_DEFAULT_STORAGE_CLASS=
# K8S_STORAGE_SP_DEFAULT_ACCESS_MODE=ReadWriteOnce

# Three-tier demo app service provider (profile: three-tier)
# Same kubeconfig + cluster namespace as k8s-container (K8S_CONTAINER_SP_* above).
# THREE_TIER_SP_NAME=three-tier-provider

# ACM cluster service provider (profile: acm-cluster)
# Supports two platforms: KubeVirt (default) and BareMetal.
# Both enabled by default (SP_ENABLED_PLATFORMS=kubevirt,baremetal).
# ACM_CLUSTER_SP_NAME=acm-cluster-sp
# ACM_CLUSTER_SP_BASE_DOMAIN=apps.example.com
# ACM_CLUSTER_SP_PULL_SECRET=<base64-encoded-dockerconfigjson>
# BareMetal platform only — not used by KubeVirt:
# ACM_CLUSTER_SP_DEFAULT_INFRA_ENV=my-infra-env
# ACM_CLUSTER_SP_AGENT_NAMESPACE=my-agent-namespace
# Environment agent (profile: environment-agent) — required when using the agent profile
# See deploy/docs/environment-agent-kind.md
# AGENT_NAME=local-agent
# AGENT_EMBEDDED_SPS=container,vm # required; compose has no default (e.g. container, vm, cluster, storage)
# AGENT_KUBECONFIG_HOST=.kube/config # written by make kubeconfig-for-compose
# SP_CONTAINER_NAMESPACE=default
# SP_K8S_EXTERNAL_SVC_TYPE=NodePort
# SP_VM_NAMESPACE=default
# SP_CLUSTER_NAMESPACE=clusters
# SP_PULL_SECRET=<base64-encoded-dockerconfigjson>
# SP_BASE_DOMAIN=apps.example.com
# SP_STORAGE_NAMESPACE=default
# SP_K8S_DEFAULT_STORAGE_CLASS=
# SP_K8S_DEFAULT_ACCESS_MODE=ReadWriteOnce
# ENVIRONMENT_AGENT_VERSION=main

# --- Service image versions ---
# Pin specific versions instead of "main". Valid values:
Expand All @@ -49,9 +38,5 @@
# v0.0.1-rc.3 - release candidate (from release branch)
# abc1234 - specific commit build (for local testing only)
# CONTROL_PLANE_VERSION=main
# KUBEVIRT_SERVICE_PROVIDER_VERSION=main
# K8S_CONTAINER_SERVICE_PROVIDER_VERSION=main
# K8S_STORAGE_SERVICE_PROVIDER_VERSION=main
# ACM_CLUSTER_SERVICE_PROVIDER_VERSION=main
# THREE_TIER_DEMO_SERVICE_PROVIDER_VERSION=main
# ENVIRONMENT_AGENT_VERSION=main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated

# DCM_UI_VERSION=main
Loading