-
Notifications
You must be signed in to change notification settings - Fork 6
Add helm chart for deploying fastcs IOC instances #184
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
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
75294e2
first pass at helm chart for fastcs instances
gilesknap 5998045
fix service name
gilesknap 50fe871
better port exposure for service.yaml
gilesknap af53272
add helm chart publishing
gilesknap 4ad591c
remove service account creation from helm
gilesknap 0d4cbfa
switch to using Charts folder with subfolders for charts
gilesknap d702263
add schema for fastcs-instance chart values.yaml
gilesknap 75fbfc3
publish chart values schemas
gilesknap 133f315
publish chart values schemas
gilesknap 7acb773
add schema generation to pre-commit
gilesknap 946aad2
fixing the fastcs-instance chart schema
gilesknap 2e1d26d
rename charts to remove "instance"
gilesknap 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,71 @@ | ||
| name: Package helm charts | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| env: | ||
| HELM_VERSION_TO_INSTALL: 3.14.3 | ||
|
|
||
| jobs: | ||
| package-helm-charts: | ||
| name: Package and Push Helm Chart | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install helm | ||
| uses: Azure/setup-helm@v3 | ||
| with: | ||
| version: ${{ env.HELM_VERSION_TO_INSTALL }} | ||
|
|
||
| # Check that alpha/beta versions have the form X.Y.Z-alpha.A requried by Helm. | ||
| # An early check saves waiting for the entire build before finding a problem. | ||
| - name: Check helm version tag | ||
| if: ${{ github.ref_type == 'tag' }} | ||
| env: | ||
| VERSION: "${{ github.ref_name }}" | ||
| run: | | ||
| if [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-alpha|-beta|-rc).*?$ ]]; then | ||
| echo "Valid version format: ${VERSION}" | ||
| else | ||
| echo "Invalid version: ${VERSION}. Expected: X.Y.Z or X.Y.Z-beta.1 or X.Y.Z-alpha.1" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Package helm charts | ||
| env: | ||
| VERSION: "${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}" | ||
| run: | | ||
| set -xe | ||
|
|
||
| mkdir -p charts | ||
| for i in Charts/*; do | ||
| if [[ ${i} =~ ^.*-ioc$ ]]; then | ||
| echo "Skipping IOC schema chart: ${i}" | ||
| continue | ||
| fi | ||
| echo "Packaging chart: ${i}" | ||
| helm package -u --app-version ${VERSION} --version ${VERSION} ${i} | ||
| mv $(basename ${i})-*.tgz charts/ | ||
| done | ||
|
|
||
| - name: Upload helm chart values schemas | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: helm-chart-schemas | ||
| path: schemas/ | ||
|
|
||
| - name: Push tagged helm chart to registry | ||
| if: ${{ github.ref_type == 'tag' }} | ||
| run: | | ||
| set -x | ||
|
|
||
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io/${{ github.repository_owner }} --username ${{ github.repository_owner }} --password-stdin | ||
| REGISTRY=oci://ghcr.io/diamondlightsource/charts | ||
| for i in charts/*.tgz; do | ||
| helm push "${i}" ${REGISTRY} | ||
| done | ||
gilesknap marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,8 @@ | ||
| apiVersion: v2 | ||
| name: fastcs-instance-ioc | ||
| version: 0.1.0 | ||
| # This chart allows generating a schema for the fastcs-instance-ioc values file. | ||
| # fastcs-instance-ioc schema is used by IOC instances which have fastcs-instance | ||
| # as a dependency. | ||
| # | ||
| # This chart is never used except by helm-schema. |
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,249 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "fastcs": { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "affinity": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Affinity", | ||
| "description": "Affinity for the pod", | ||
| "required": [], | ||
| "title": "affinity", | ||
| "type": "object" | ||
| }, | ||
| "args": { | ||
| "description": "arguments to pass to the above command", | ||
| "items": { | ||
| "required": [], | ||
| "type": "string" | ||
| }, | ||
| "required": [], | ||
| "title": "args", | ||
| "type": "array" | ||
| }, | ||
| "baseIp": { | ||
| "default": "10.96.0.0/12", | ||
| "description": "Used by allocateIpFromName to allocate a fixed cluster IP for the service.\nThe default is the same for all DLS clusters.\n", | ||
| "pattern": "^(\\d{1,3}\\.){3}\\d{1,3}\\/\\d{1,2}$", | ||
| "required": [], | ||
| "title": "CIDR for services addresses.", | ||
| "type": "string" | ||
| }, | ||
| "ca_server_port": { | ||
| "default": 5064, | ||
| "description": "service port for Channel Access", | ||
| "required": [], | ||
| "title": "ca_server_port", | ||
| "type": "integer" | ||
| }, | ||
| "clusterIP": { | ||
| "default": "", | ||
| "format": "ipv4", | ||
| "required": [], | ||
| "title": "Override for the cluster IP - only needed if allocateIpFromName clashes", | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ] | ||
| }, | ||
| "command": { | ||
| "description": "Command to run in the container (as array of arguments)", | ||
| "items": { | ||
| "required": [], | ||
| "type": "string" | ||
| }, | ||
| "required": [], | ||
| "title": "command", | ||
| "type": "array" | ||
| }, | ||
| "extra_containers": { | ||
| "description": "adds addtional containers specified by image and command", | ||
| "items": { | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "command": { | ||
| "description": "Command to run in the container (as array of arguments)", | ||
| "required": [], | ||
| "type": "array" | ||
| }, | ||
| "image": { | ||
| "description": "Container image URI", | ||
| "format": "image", | ||
| "required": [], | ||
| "type": "string" | ||
| }, | ||
| "name": { | ||
| "description": "A name for the additional container", | ||
| "required": [], | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "name", | ||
| "image", | ||
| "command" | ||
| ], | ||
| "type": "object" | ||
| }, | ||
| "required": [], | ||
| "title": "extra_containers", | ||
| "type": "array" | ||
| }, | ||
| "global": { | ||
| "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", | ||
| "required": [], | ||
| "title": "global", | ||
| "type": "object" | ||
| }, | ||
| "image": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Container/properties/image", | ||
| "required": [], | ||
| "title": "image", | ||
| "type": "string" | ||
| }, | ||
| "iocConfig": { | ||
| "default": "/epics/ioc/config", | ||
| "description": "location of config folder (defaults to be the same as C++ IOCs)", | ||
| "required": [], | ||
| "title": "iocConfig", | ||
| "type": "string" | ||
| }, | ||
| "livenessProbe": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Probe", | ||
| "required": [], | ||
| "title": "livenessProbe", | ||
| "type": "object" | ||
| }, | ||
| "nodeSelector": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.NodeSelector", | ||
| "description": "Node selector for the pod", | ||
| "required": [], | ||
| "title": "nodeSelector", | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ] | ||
| }, | ||
| "podAnnotations": { | ||
| "additionalProperties": false, | ||
| "required": [], | ||
| "title": "Pod Annotations", | ||
| "type": "object" | ||
| }, | ||
| "podLabels": { | ||
| "additionalProperties": false, | ||
| "required": [], | ||
| "title": "Pod Labels", | ||
| "type": "object" | ||
| }, | ||
| "podSecurityContext": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.SecurityContext", | ||
| "required": [], | ||
| "title": "Pod Security Context", | ||
| "type": "object" | ||
| }, | ||
| "pva_server_port": { | ||
| "default": 5075, | ||
| "description": "service port for PV Access", | ||
| "required": [], | ||
| "title": "pva_server_port", | ||
| "type": "integer" | ||
| }, | ||
| "readinessProbe": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Probe", | ||
| "required": [], | ||
| "title": "readinessProbe", | ||
| "type": "object" | ||
| }, | ||
| "resources": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements", | ||
| "required": [], | ||
| "title": "Resource limits and requests", | ||
| "type": "object" | ||
| }, | ||
| "securityContext": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.SecurityContext", | ||
| "required": [], | ||
| "title": "Container Security Context", | ||
| "type": "object" | ||
| }, | ||
| "service": { | ||
| "additionalProperties": false, | ||
| "description": "The service will be configured for Channel Access and PVA. Here you can override\nthe ports and also make this a LoadBalancer service if required.\n", | ||
| "properties": { | ||
| "ca_port": { | ||
| "default": 5064, | ||
| "required": [], | ||
| "title": "ca_port", | ||
| "type": "integer" | ||
| }, | ||
| "pva_port": { | ||
| "default": 5075, | ||
| "required": [], | ||
| "title": "pva_port", | ||
| "type": "integer" | ||
| }, | ||
| "type": { | ||
| "default": "ClusterIP", | ||
| "required": [], | ||
| "title": "type", | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "type", | ||
| "ca_port", | ||
| "pva_port" | ||
| ], | ||
| "title": "service", | ||
| "type": "object" | ||
| }, | ||
| "tolerations": { | ||
| "description": "Tolerations for the pod", | ||
| "items": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Toleration", | ||
| "required": [], | ||
| "type": "object" | ||
| }, | ||
| "required": [], | ||
| "title": "tolerations", | ||
| "type": "array" | ||
| }, | ||
| "volumeMounts": { | ||
| "items": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.VolumeMount", | ||
| "required": [], | ||
| "type": "object" | ||
| }, | ||
| "required": [], | ||
| "title": "volumeMounts", | ||
| "type": "array" | ||
| }, | ||
| "volumes": { | ||
| "description": "Additional volumes to mount in the output Deployment definition.", | ||
| "items": { | ||
| "$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Volume", | ||
| "required": [], | ||
| "type": "object" | ||
| }, | ||
| "required": [], | ||
| "title": "volumes", | ||
| "type": "array" | ||
| } | ||
| }, | ||
| "required": [], | ||
| "title": "fastcs", | ||
| "type": "object" | ||
| }, | ||
| "global": { | ||
| "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", | ||
| "required": [], | ||
| "title": "global", | ||
| "type": "object" | ||
| } | ||
| }, | ||
| "required": [], | ||
| "type": "object" | ||
| } |
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 @@ | ||
| # yaml-language-server: $schema=values.schema.json | ||
|
|
||
| # @schema | ||
| # title: FastCS IOC Values | ||
| # description: Values for the FastCS IOC instance | ||
| # type: object | ||
| # $ref: ../fastcs/values.schema.json | ||
| # @schema | ||
| fastcs: {} |
Oops, something went wrong.
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.