This repository was archived by the owner on Jun 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Add helm chart to deploy on k8s/openshift #39
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| apiVersion: v2 | ||
| name: dcm | ||
| description: DCM API Gateway and managers for Kubernetes and OpenShift | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "main" | ||
| keywords: | ||
| - dcm | ||
| - api-gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # DCM Helm Chart | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Kubernetes 1.24+ or OpenShift 4.12+ | ||
| - Helm 3.x | ||
| - A default StorageClass configured in the cluster (for PostgreSQL and NATS persistent volumes) | ||
|
|
||
| ## Quick Start | ||
|
|
||
| Install all the components with a kubernetes provider using default namespace. | ||
|
|
||
| ### OpenShift | ||
|
|
||
| ```bash | ||
| helm install dcm helm/dcm \ | ||
| --set k8sContainerServiceProvider.enabled=true \ | ||
| --set k8sContainerServiceProvider.namespace=default | ||
| ``` | ||
|
|
||
| OpenShift Routes are enabled by default for the API gateway and DCM UI. | ||
|
|
||
| ### Kubernetes | ||
|
|
||
| ```bash | ||
| helm install dcm helm/dcm \ | ||
| --set gateway.route.enabled=false \ | ||
| --set dcmUi.route.enabled=false | ||
| --set k8sContainerServiceProvider.enabled=true \ | ||
| --set k8sContainerServiceProvider.namespace=default | ||
| ``` | ||
|
|
||
| Access via port-forward: | ||
|
|
||
| ```bash | ||
| kubectl port-forward svc/dcm-gateway 9080:9080 | ||
| kubectl port-forward svc/dcm-dcm-ui 7007:7007 | ||
| ``` | ||
|
|
||
| Then open: | ||
| - API Gateway: http://localhost:9080 | ||
| - DCM UI: http://localhost:7007 | ||
|
|
||
| ## Enabling Service Providers | ||
|
|
||
| ### KubeVirt Service Provider | ||
|
|
||
| Manages virtual machines via KubeVirt. | ||
|
|
||
| ```bash | ||
| helm upgrade dcm helm/dcm --reuse-values \ | ||
| --set kubevirtServiceProvider.enabled=true \ | ||
| --set kubevirtServiceProvider.namespace=default | ||
| ``` | ||
|
|
||
| ### ACM Cluster Service Provider | ||
|
|
||
| Manages clusters via Red Hat Advanced Cluster Management. | ||
|
|
||
| ```bash | ||
| helm upgrade dcm helm/dcm --reuse-values \ | ||
| --set acmClusterServiceProvider.enabled=true \ | ||
| --set acmClusterServiceProvider.namespace=default \ | ||
| --set acmClusterServiceProvider.baseDomain=example.com | ||
| ``` | ||
|
|
||
| ### Three-Tier Demo Service Provider | ||
|
Contributor
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. do we need to support this still? 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. let's support it till we have a replacement |
||
|
|
||
| A demo provider for a three-tier application. Requires the Kubernetes Container Service Provider to also be enabled. | ||
|
|
||
| ```bash | ||
| helm upgrade dcm helm/dcm --reuse-values \ | ||
| --set k8sContainerServiceProvider.enabled=true \ | ||
| --set threeTierDemoServiceProvider.enabled=true | ||
| ``` | ||
|
|
||
| ## Uninstall | ||
|
|
||
| ```bash | ||
| helm uninstall dcm | ||
| ``` | ||
|
|
||
| Note: PersistentVolumeClaims for PostgreSQL and NATS are not deleted automatically. To remove them: | ||
|
|
||
| ```bash | ||
| kubectl delete pvc -l app.kubernetes.io/instance=dcm | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "dcm.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Fullname helper. | ||
| */}} | ||
| {{- define "dcm.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels. | ||
| */}} | ||
| {{- define "dcm.labels" -}} | ||
| helm.sh/chart: {{ include "dcm.name" . }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/part-of: dcm | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels for a component. | ||
| Usage: {{ include "dcm.selectorLabels" (dict "context" . "component" "gateway") }} | ||
| */}} | ||
| {{- define "dcm.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ .component }} | ||
| app.kubernetes.io/instance: {{ .context.Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Resolve image tag: per-component tag > global.imageTag > "main" | ||
| Usage: {{ include "dcm.imageTag" (dict "tag" .Values.serviceProviderManager.tag "global" .Values.global) }} | ||
| */}} | ||
| {{- define "dcm.imageTag" -}} | ||
| {{- default (default "main" .global.imageTag) .tag }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Init container that waits for postgres to be ready. | ||
| Usage: {{ include "dcm.waitForPostgres" . | nindent 8 }} | ||
| */}} | ||
| {{- define "dcm.waitForPostgres" -}} | ||
| - name: wait-for-postgres | ||
| image: {{ .Values.postgres.image }} | ||
| command: ["sh", "-c", "until pg_isready -h {{ include "dcm.fullname" . }}-postgres -p 5432 -U {{ .Values.postgres.user }}; do echo 'Waiting for postgres...'; sleep 2; done"] | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| {{- if .Values.acmClusterServiceProvider.enabled }} | ||
| {{- if .Values.acmClusterServiceProvider.kubeconfig }} | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ include "dcm.fullname" . }}-acm-cluster-kubeconfig | ||
| labels: | ||
| {{- include "dcm.labels" . | nindent 4 }} | ||
| type: Opaque | ||
| data: | ||
| kubeconfig: {{ .Values.acmClusterServiceProvider.kubeconfig | b64enc | quote }} | ||
| --- | ||
| {{- end }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "dcm.fullname" . }}-acm-cluster-service-provider | ||
| labels: | ||
| {{- include "dcm.labels" . | nindent 4 }} | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "acm-cluster-service-provider") | nindent 4 }} | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "acm-cluster-service-provider") | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "acm-cluster-service-provider") | nindent 8 }} | ||
| spec: | ||
| containers: | ||
| - name: acm-cluster-service-provider | ||
| image: "{{ .Values.acmClusterServiceProvider.image }}:{{ include "dcm.imageTag" (dict "tag" .Values.acmClusterServiceProvider.tag "global" .Values.global) }}" | ||
| ports: | ||
| - containerPort: 8080 | ||
| protocol: TCP | ||
| env: | ||
| - name: SP_NAME | ||
| value: {{ .Values.acmClusterServiceProvider.spName | quote }} | ||
| - name: SP_ENDPOINT | ||
| value: "http://{{ include "dcm.fullname" . }}-acm-cluster-service-provider:8080" | ||
| - name: DCM_REGISTRATION_URL | ||
| value: "http://{{ include "dcm.fullname" . }}-service-provider-manager:8080/api/v1alpha1" | ||
| - name: SP_NATS_URL | ||
| value: "nats://{{ include "dcm.fullname" . }}-nats:4222" | ||
| - name: SP_CLUSTER_NAMESPACE | ||
| value: {{ .Values.acmClusterServiceProvider.namespace | quote }} | ||
| {{- if .Values.acmClusterServiceProvider.baseDomain }} | ||
| - name: SP_BASE_DOMAIN | ||
| value: {{ .Values.acmClusterServiceProvider.baseDomain | quote }} | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.pullSecret }} | ||
| - name: SP_PULL_SECRET | ||
| value: {{ .Values.acmClusterServiceProvider.pullSecret | quote }} | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.defaultInfraEnv }} | ||
| - name: SP_DEFAULT_INFRA_ENV | ||
| value: {{ .Values.acmClusterServiceProvider.defaultInfraEnv | quote }} | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.agentNamespace }} | ||
| - name: SP_AGENT_NAMESPACE | ||
| value: {{ .Values.acmClusterServiceProvider.agentNamespace | quote }} | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.kubeconfig }} | ||
| - name: KUBECONFIG | ||
| value: /kubeconfig/kubeconfig | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.kubeconfig }} | ||
| volumeMounts: | ||
| - name: kubeconfig | ||
| mountPath: /kubeconfig | ||
| readOnly: true | ||
| {{- end }} | ||
| {{- if .Values.acmClusterServiceProvider.kubeconfig }} | ||
| volumes: | ||
| - name: kubeconfig | ||
| secret: | ||
| secretName: {{ include "dcm.fullname" . }}-acm-cluster-kubeconfig | ||
| {{- end }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "dcm.fullname" . }}-acm-cluster-service-provider | ||
| labels: | ||
| {{- include "dcm.labels" . | nindent 4 }} | ||
| spec: | ||
| selector: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "acm-cluster-service-provider") | nindent 4 }} | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| protocol: TCP | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "dcm.fullname" . }}-catalog-manager | ||
| labels: | ||
| {{- include "dcm.labels" . | nindent 4 }} | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "catalog-manager") | nindent 4 }} | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "catalog-manager") | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "catalog-manager") | nindent 8 }} | ||
| spec: | ||
| initContainers: | ||
| {{- include "dcm.waitForPostgres" . | nindent 8 }} | ||
| containers: | ||
| - name: catalog-manager | ||
| image: "{{ .Values.catalogManager.image }}:{{ include "dcm.imageTag" (dict "tag" .Values.catalogManager.tag "global" .Values.global) }}" | ||
| ports: | ||
| - containerPort: 8080 | ||
| protocol: TCP | ||
| envFrom: | ||
| - secretRef: | ||
| name: {{ include "dcm.fullname" . }}-db | ||
| env: | ||
| - name: DB_TYPE | ||
| value: pgsql | ||
| - name: DB_HOST | ||
| value: {{ include "dcm.fullname" . }}-postgres | ||
| - name: DB_PORT | ||
| value: "5432" | ||
| - name: DB_NAME | ||
| value: catalog-manager | ||
| - name: BIND_ADDRESS | ||
| value: ":8080" | ||
| - name: PLACEMENT_MANAGER_URL | ||
| value: "http://{{ include "dcm.fullname" . }}-placement-manager:8080" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "dcm.fullname" . }}-catalog-manager | ||
| labels: | ||
| {{- include "dcm.labels" . | nindent 4 }} | ||
| spec: | ||
| selector: | ||
| {{- include "dcm.selectorLabels" (dict "context" . "component" "catalog-manager") | nindent 4 }} | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| protocol: TCP |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
do we want to support vanilla K8s? Like ACM is only for OCP no?
Maybe some components can be run on vanilla K8s so we should have separated sections maybe?
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.
ACM is not needed if we do not deploy clusters. Let's try to support both k8s and ocp