-
Notifications
You must be signed in to change notification settings - Fork 12
Add image Makefile targets and Helm chart (HYPERFLEET-312) #14
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
Merged
openshift-merge-bot
merged 5 commits into
openshift-hyperfleet:main
from
ciaranRoche:HYPERFLEET-312
Dec 11, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
102aaf6
Add image Makefile targets and Helm chart (HYPERFLEET-312)
ciaranRoche ba0c890
Address PR review feedback for Helm chart
ciaranRoche 3e39da1
Fix Helm chart for Kubernetes deployment (HYPERFLEET-312)
ciaranRoche 11714b8
Address PR review comments for Helm chart and Dockerfile
ciaranRoche ca7bfac
Add OpenAPI schema to Docker image for validation
ciaranRoche 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 |
|---|---|---|
| @@ -1,21 +1,58 @@ | ||
| FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2-750.1697534106 | ||
| # OpenAPI generation stage | ||
| FROM openapitools/openapi-generator-cli:v7.16.0 AS openapi-gen | ||
|
|
||
| RUN \ | ||
| microdnf install -y \ | ||
| util-linux \ | ||
| && \ | ||
| microdnf clean all | ||
| WORKDIR /local | ||
|
|
||
| COPY \ | ||
| hyperfleet-api \ | ||
| /usr/local/bin/ | ||
| # Copy OpenAPI spec | ||
| COPY openapi/openapi.yaml /local/openapi/openapi.yaml | ||
|
|
||
| # Generate Go client/models from OpenAPI spec | ||
| RUN bash /usr/local/bin/docker-entrypoint.sh generate \ | ||
| -i /local/openapi/openapi.yaml \ | ||
| -g go \ | ||
| -o /local/pkg/api/openapi && \ | ||
| rm -f /local/pkg/api/openapi/go.mod /local/pkg/api/openapi/go.sum && \ | ||
| rm -rf /local/pkg/api/openapi/test | ||
|
|
||
| # Build stage | ||
| FROM golang:1.24-alpine AS builder | ||
|
|
||
| WORKDIR /build | ||
|
|
||
| # Copy go mod files | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| # Copy source code | ||
| COPY . . | ||
|
|
||
| # Copy generated OpenAPI code from openapi-gen stage | ||
| COPY --from=openapi-gen /local/pkg/api/openapi ./pkg/api/openapi | ||
|
|
||
| # Build binary | ||
| RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o hyperfleet-api ./cmd/hyperfleet-api | ||
|
|
||
| # Runtime stage | ||
| FROM gcr.io/distroless/static-debian12:nonroot | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy binary from builder | ||
| COPY --from=builder /build/hyperfleet-api /app/hyperfleet-api | ||
|
|
||
| # Copy OpenAPI schema for validation (uses the source spec, not the generated one) | ||
| COPY --from=builder /build/openapi/openapi.yaml /app/openapi/openapi.yaml | ||
|
|
||
| # Set default schema path (can be overridden by Helm for provider-specific schemas) | ||
| ENV OPENAPI_SCHEMA_PATH=/app/openapi/openapi.yaml | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/hyperfleet-api", "serve"] | ||
| ENTRYPOINT ["/app/hyperfleet-api"] | ||
| CMD ["serve"] | ||
|
|
||
| LABEL name="hyperfleet-api" \ | ||
| vendor="Red Hat" \ | ||
| version="0.0.1" \ | ||
| summary="HyperFleet API" \ | ||
| description="HyperFleet API" | ||
| summary="HyperFleet API - Cluster Lifecycle Management Service" \ | ||
| description="HyperFleet API for cluster lifecycle management" | ||
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
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
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,26 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ | ||
| # Parent directory patterns | ||
| ../.git/ | ||
| ../../.git/ |
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,15 @@ | ||
| apiVersion: v2 | ||
| name: hyperfleet-api | ||
| description: HyperFleet API - Cluster Lifecycle Management Service | ||
| type: application | ||
| version: 1.0.0 | ||
| appVersion: "1.0.0" | ||
| maintainers: | ||
| - name: HyperFleet Team | ||
| email: hyperfleet-team@redhat.com | ||
| keywords: | ||
| - hyperfleet | ||
| - api | ||
| - kubernetes | ||
| - cluster-management | ||
| home: https://github.com/openshift-hyperfleet/hyperfleet-api |
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,63 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "hyperfleet-api.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "hyperfleet-api.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 }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "hyperfleet-api.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "hyperfleet-api.labels" -}} | ||
| helm.sh/chart: {{ include "hyperfleet-api.chart" . }} | ||
| {{ include "hyperfleet-api.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "hyperfleet-api.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "hyperfleet-api.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/component: api | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "hyperfleet-api.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "hyperfleet-api.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} |
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.
Uh oh!
There was an error while loading. Please reload this page.