Skip to content
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

Add deployment helm chart. #45

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/check_charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Lint and Test Charts

on:
push:
branches:
- main
tags:
- '*'
paths:
# Only run test and docker publish if some code have changed
- 'deployment/k8s/charts/**'
- '.github/workflows/check_charts.yaml'
- 'pyproject.toml'
pull_request:

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.9.2

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --chart-dirs deployment/k8s --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi

- name: Run chart-testing (lint)
run: ct lint --chart-dirs deployment/k8s --target-branch ${{ github.event.repository.default_branch }}

- name: Build container
uses: docker/build-push-action@v6
if: steps.list-changed.outputs.changed == 'true'
with:
# See https://github.com/developmentseed/titiler/discussions/387
platforms: linux/amd64
context: .
file: Dockerfile
push: false
tags: "titiler-openeo:dev"

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Load container image in kind cluster
run: kind load docker-image titiler-openeo:dev --name chart-testing
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install --chart-dirs deployment/k8s
if: steps.list-changed.outputs.changed == 'true'
18 changes: 18 additions & 0 deletions deployment/k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## k8s / Helm Deployment

Try locally

```
# set up minikube locally
minikube start
kubectl config use-context minikube

# run in the k8s directory
helm upgrade --install titiler-openeo .

# then you may want to get the ingress
minikube addons enable ingress

# obtain the ip and port the service is locally available at
minikube service ingress-nginx-controller -n ingress-nginx --url | head -n 1
```
22 changes: 22 additions & 0 deletions deployment/k8s/charts/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
9 changes: 9 additions & 0 deletions deployment/k8s/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
appVersion: 0.1.0
description: OpenEO by TiTiler
name: titiler-openeo
version: 0.1.0
icon: https://raw.githubusercontent.com/developmentseed/titiler/main/docs/logos/TiTiler_logo_small.png
maintainers:
- name: DevelopmentSeed
url: https://github.com/developmentseed
5 changes: 5 additions & 0 deletions deployment/k8s/charts/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
replicaCount: 1

image:
repository: titiler-openeo
tag: dev
Loading
Loading