-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from mzeevi/ci/addHelm
ci: add helm chart to repo with release workflow
- Loading branch information
Showing
20 changed files
with
888 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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,95 @@ | ||
name: release | ||
on: | ||
release: | ||
types: [published] | ||
env: | ||
REGISTRY: ghcr.io | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
DANA_ORG: dana-team | ||
|
||
jobs: | ||
build-and-push-image: | ||
name: Build and push image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push image | ||
run: make docker-build docker-push IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}:${GITHUB_REF##*/} | ||
|
||
- name: Create install.yaml file | ||
run: make build-installer IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}:${GITHUB_REF##*/} | ||
|
||
- name: Upload install.yaml file | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: dist/install.yaml | ||
|
||
build-and-push-helm-chart: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 | ||
with: | ||
version: v3.12.0 | ||
|
||
- name: Set chart name | ||
id: chart-name | ||
run: echo "value=${{ github.event.repository.name }}" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Set OCI registry name | ||
id: oci-registry-name | ||
run: echo "value=ghcr.io/${{ github.repository_owner }}/helm-charts" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Set OCI chart name | ||
id: oci-chart-name | ||
run: echo "value=${{ steps.oci-registry-name.outputs.value }}/${{ steps.chart-name.outputs.value }}" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Helm lint | ||
run: helm lint charts/${{ steps.chart-name.outputs.value }} | ||
|
||
- name: Trim prefix from version | ||
id: version | ||
run: echo "value=$(echo ${{ github.ref_name }} | sed 's/release-//')" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Helm package | ||
id: build | ||
run: | | ||
helm package charts/${{ steps.chart-name.outputs.value }} --version ${{ steps.version.outputs.value }} --app-version ${{ steps.version.outputs.value }} | ||
echo "package=${{ steps.chart-name.outputs.value }}-${{ steps.version.outputs.value }}.tgz" >> "$GITHUB_OUTPUT" | ||
- name: Upload chart as artifact | ||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | ||
with: | ||
name: "[${{ github.job }}] Helm chart" | ||
path: ${{ steps.build.outputs.package }} | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Helm push | ||
run: helm push ${{ steps.build.outputs.package }} oci://${{ steps.oci-registry-name.outputs.value }} | ||
env: | ||
HELM_REGISTRY_CONFIG: ~/.docker/config.json |
This file contains 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 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 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,23 @@ | ||
# 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/ |
This file contains 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,24 @@ | ||
apiVersion: v2 | ||
name: rcs-ocm-addons | ||
description: A Helm chart for the rcs-score-addon | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.0.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "latest" |
This file contains 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,44 @@ | ||
# rcs-ocm-addons | ||
|
||
![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) | ||
|
||
A Helm chart for the rcs-score-addon | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | Node affinity rules for scheduling pods. Allows you to specify advanced node selection constraints. | | ||
| deploymentConfig | object | `{"agentInstallNamespace":"open-cluster-management-agent-addon","customizedVariables":[{"name":"MAX_CPU_COUNT","value":"1"},{"name":"MIN_CPU_COUNT","value":"0"},{"name":"MAX_MEMORY_BYTES","value":"104857"},{"name":"MIN_MEMORY_BYTES","value":"0"}],"name":"rcs-score-deploy-config","namespace":"open-cluster-management-hub"}` | Configurations for the AddonDeploymentConfig object | | ||
| deploymentConfig.agentInstallNamespace | string | `"open-cluster-management-agent-addon"` | Namespace where the agent addon is installed | | ||
| deploymentConfig.customizedVariables | list | `[{"name":"MAX_CPU_COUNT","value":"1"},{"name":"MIN_CPU_COUNT","value":"0"},{"name":"MAX_MEMORY_BYTES","value":"104857"},{"name":"MIN_MEMORY_BYTES","value":"0"}]` | Customzied variables for the addon | | ||
| deploymentConfig.name | string | `"rcs-score-deploy-config"` | Name of the AddonDeploymentConfig | | ||
| deploymentConfig.namespace | string | `"open-cluster-management-hub"` | Namespace of the AddonDeploymentConfig | | ||
| fullnameOverride | string | `""` | | | ||
| image.pullPolicy | string | `"IfNotPresent"` | The pull policy for the image. | | ||
| image.repository | string | `"ghcr.io/dana-team/rcs-ocm-addons"` | The repository of the manager container image. | | ||
| image.tag | string | `""` | The tag of the manager container image. | | ||
| installStrategy.score.placements[0].configs[0].group | string | `"addon.open-cluster-management.io"` | | | ||
| installStrategy.score.placements[0].configs[0].name | string | `"rcs-score-deploy-config"` | | | ||
| installStrategy.score.placements[0].configs[0].namespace | string | `"open-cluster-management-hu"` | | | ||
| installStrategy.score.placements[0].configs[0].resource | string | `"addondeploymentconfigs"` | | | ||
| installStrategy.score.placements[0].name | string | `"all-clusters"` | | | ||
| installStrategy.score.placements[0].namespace | string | `"test"` | | | ||
| installStrategy.score.placements[0].rolloutStrategy.type | string | `"All"` | | | ||
| installStrategy.score.type | string | `"Placements"` | | | ||
| installStrategy.status.placements[0].name | string | `"all-clusters"` | | | ||
| installStrategy.status.placements[0].namespace | string | `"test"` | | | ||
| installStrategy.status.placements[0].rolloutStrategy.type | string | `"All"` | | | ||
| installStrategy.status.type | string | `"Placements"` | | | ||
| manager | object | `{"resources":{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}},"score":{"args":["manager"],"command":["/score-addon"]},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}},"status":{"args":["manager"],"command":["/status-addon"]}}` | Configuration for the manager container. | | ||
| manager.resources | object | `{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}}` | Resource requests and limits for the manager container. | | ||
| manager.score.args | list | `["manager"]` | Command-line arguments passed to the score-addon manager container. | | ||
| manager.score.command | list | `["/score-addon"]` | Command-line commands passed to the score-addon manager container. | | ||
| manager.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}` | Security settings for the manager container. | | ||
| manager.status.args | list | `["manager"]` | Command-line arguments passed to the status-adon manager container. | | ||
| manager.status.command | list | `["/status-addon"]` | Command-line commands passed to the status-addon manager container. | | ||
| nameOverride | string | `""` | | | ||
| nodeSelector | object | `{}` | Node selector for scheduling pods. Allows you to specify node labels for pod assignment. | | ||
| replicaCount | int | `1` | The number of replicas for the deployment. | | ||
| tolerations | list | `[]` | Node tolerations for scheduling pods. Allows the pods to be scheduled on nodes with matching taints. | | ||
|
This file contains 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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "rcs-ocm-addons.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 "rcs-ocm-addons.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 "rcs-ocm-addons.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "rcs-ocm-addons.labels" -}} | ||
helm.sh/chart: {{ include "rcs-ocm-addons.chart" . }} | ||
{{ include "rcs-ocm-addons.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "rcs-ocm-addons.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "rcs-ocm-addons.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "rcs-ocm-addons.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "rcs-ocm-addons.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.