-
Notifications
You must be signed in to change notification settings - Fork 230
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 #1635 from eclipse-ditto/helm-chart
Provide Helm chart in Ditto repository
- Loading branch information
Showing
76 changed files
with
6,454 additions
and
13 deletions.
There are no files selected for viewing
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,20 @@ | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
|
||
# consider helm install to be failed after 10 minutes | ||
helm-extra-args: --timeout 10m | ||
check-version-increment: true | ||
debug: true | ||
chart-dirs: | ||
- deployment/helm | ||
chart-repos: | ||
- stable=https://charts.helm.sh/stable | ||
- bitnami=https://charts.bitnami.com/bitnami |
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,37 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
|
||
# | ||
# use kubeval to validate helm generated kubernetes manifest | ||
# | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
CHART_DIR=deployment/helm/ditto | ||
KUBEVAL_VERSION="v0.16.1" | ||
SCHEMA_LOCATION="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/" | ||
|
||
# install kubeval | ||
curl --silent --show-error --fail --location --output /tmp/kubeval.tar.gz https://github.com/instrumenta/kubeval/releases/download/"${KUBEVAL_VERSION}"/kubeval-linux-amd64.tar.gz | ||
sudo tar -C /usr/local/bin -xf /tmp/kubeval.tar.gz kubeval | ||
|
||
# add helm repos to resolve dependencies | ||
helm repo add stable https://charts.helm.sh/stable | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
|
||
# validate chart | ||
echo "helm dependency build..." | ||
helm dependency build "${CHART_DIR}" | ||
|
||
echo "kubeval(idating) ${CHART_DIR} chart..." | ||
helm template "${CHART_DIR}" | kubeval --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}" |
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,34 @@ | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
name: Release and publish Helm chart | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
chartVersion: | ||
description: 'Helm chart version' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Package and push Ditto Helm chart to Docker Hub | ||
uses: appany/[email protected] | ||
with: | ||
repository: eclipse | ||
name: ditto | ||
tag: ${{ inputs.chartVersion }} | ||
path: deployment/helm/ditto | ||
registry: registry-1.docker.io | ||
registry_username: eclipsedittobot | ||
registry_password: ${{ secrets.DOCKER_HUB_TOKEN }} |
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,129 @@ | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
name: Lint and test Helm chart | ||
|
||
env: | ||
CONFIG_OPTION_CHART_TESTING: "--config .github/ct.yml" | ||
VERSION_CHART_TESTING: "v3.8.0" | ||
VERSION_HELM: "v3.11.2" | ||
VERSION_PYTHON: "3.9" | ||
on: | ||
pull_request: | ||
paths: | ||
- 'deployment/helm/**' | ||
- '.github/workflows/helm-chart.yml' | ||
- '.github/ct.yml' | ||
- '.github/kubeval.sh' | ||
|
||
jobs: | ||
lint-chart: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: ${{ env.VERSION_HELM }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.VERSION_PYTHON }} | ||
check-latest: true | ||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
with: | ||
version: ${{ env.VERSION_CHART_TESTING }} | ||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Run chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }} | ||
|
||
kubeval-chart: | ||
runs-on: ubuntu-latest | ||
needs: lint-chart | ||
strategy: | ||
matrix: | ||
# the versions supported by kubeval are the ones for | ||
# which a folder exists at | ||
# https://github.com/yannh/kubernetes-json-schema/ | ||
k8s: | ||
- v1.25.2 | ||
- v1.26.4 | ||
- v1.27.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Fetch history for chart testing | ||
run: git fetch --prune --unshallow | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: ${{ env.VERSION_HELM }} | ||
- name: Run kubeval | ||
env: | ||
KUBERNETES_VERSION: ${{ matrix.k8s }} | ||
run: .github/kubeval.sh | ||
|
||
install-chart: | ||
name: install-chart | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint-chart | ||
- kubeval-chart | ||
strategy: | ||
matrix: | ||
# the versions supported by chart-testing are the tags | ||
# available for the docker.io/kindest/node image | ||
# https://hub.docker.com/r/kindest/node/tags | ||
k8s: | ||
- v1.25.2 | ||
- v1.26.4 | ||
- v1.27.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Fetch history for chart testing | ||
run: git fetch --prune --unshallow | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: ${{ env.VERSION_HELM }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.VERSION_PYTHON }} | ||
check-latest: true | ||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
with: | ||
version: ${{ env.VERSION_CHART_TESTING }} | ||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Create kind ${{ matrix.k8s }} cluster | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/[email protected] | ||
with: | ||
node_image: kindest/node:${{ matrix.k8s }} | ||
- name: Run chart-testing (install) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install ${{ env.CONFIG_OPTION_CHART_TESTING }} --target-branch ${{ github.event.repository.default_branch }} |
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
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
# Eclipse Ditto :: Helm | ||
|
||
The Ditto Helm chart is managed at the [Eclipse IoT Packages](https://github.com/eclipse/packages/tree/master/charts/ditto) project. | ||
The official Ditto Helm chart is managed here, in folder [ditto](ditto/). | ||
It is deployed as "OCI artifact" to Docker Hub at: https://hub.docker.com/r/eclipse/ditto | ||
|
||
## Install Ditto via Helm Chart | ||
|
||
To install the chart with the release name eclipse-ditto, run the following commands: | ||
|
||
```shell script | ||
helm repo add eclipse-iot https://www.eclipse.org/packages/charts/ | ||
helm repo update | ||
helm install eclipse-ditto eclipse-iot/ditto | ||
helm install -n ditto my-ditto oci://registry-1.docker.io/eclipse/ditto --version <version> --wait | ||
``` | ||
|
||
# Uninstall the Helm Chart | ||
|
||
To uninstall/delete the eclipse-ditto deployment: | ||
To uninstall/delete the `my-ditto` deployment: | ||
|
||
```shell script | ||
helm delete eclipse-ditto | ||
helm uninstall my-ditto | ||
``` |
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,2 @@ | ||
charts/ | ||
Chart.lock |
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,19 @@ | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# 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,36 @@ | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
--- | ||
apiVersion: v2 | ||
name: ditto | ||
description: | | ||
Eclipse Ditto™ is a technology in the IoT implementing a software pattern called “digital twins”. | ||
A digital twin is a virtual, cloud based, representation of his real world counterpart | ||
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc). | ||
type: application | ||
version: 0.0.1 # chart version is set by release-job | ||
appVersion: 3.2.1 | ||
keywords: | ||
- iot-chart | ||
- digital-twin | ||
- IoT | ||
home: https://www.eclipse.org/ditto | ||
sources: | ||
- https://github.com/eclipse-ditto/ditto | ||
icon: https://www.eclipse.org/ditto/images/ditto.svg | ||
maintainers: | ||
- name: thjaeckle | ||
email: [email protected] | ||
dependencies: | ||
- name: mongodb | ||
repository: https://charts.bitnami.com/bitnami | ||
version: ^12.x | ||
condition: mongodb.enabled |
Oops, something went wrong.