-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
696 additions
and
19 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 |
---|---|---|
|
@@ -4,26 +4,59 @@ on: | |
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
schedule: | ||
- cron: "0 2 * * 1-5" | ||
workflow_dispatch: {} | ||
|
||
concurrency: | ||
group: "${{ github.ref }}-${{ github.workflow }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checks-out the repository | ||
- name: Check-out the repository | ||
uses: actions/checkout@v4 | ||
- name: Lints Markdown files | ||
with: | ||
# gets all history for all branches and tags (mandatory for chart-testing to work, see https://github.com/helm/chart-testing/issues/186) | ||
fetch-depth: 0 | ||
- name: Lint Markdown files | ||
uses: DavidAnson/markdownlint-cli2-action@v16 | ||
with: | ||
globs: '**/*.md' | ||
# checking shell code with ShellCheck (https://github.com/koalaman/shellcheck) | ||
- name: Installs packages | ||
# uses https://github.com/koalaman/shellcheck | ||
- name: Install Shellcheck | ||
run: sudo apt install shellcheck | ||
- name: Checks shell file code | ||
- name: Check shell file code | ||
run: | ||
shellcheck -e SC2086 -e SC2034 scripts/**/*.sh | ||
shellcheck -e SC2086 -e SC2034 -e SC2126 scripts/**/*.sh | ||
- name: Install Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.14.0 | ||
- name: Add dependency Helm chart repositories | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
check-latest: true | ||
- name: Install Helm chart-testing | ||
uses: helm/[email protected] | ||
- name: List changed Helm charts | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --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 --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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: PKG | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check-out the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.14.0 | ||
- name: Add dependency Helm chart repositories | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
- name: Host charts repository on GitHub Pages | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
- name: Setup Go environment | ||
uses: actions/setup-go@v5 | ||
- name: Generate index.html | ||
run: | | ||
go install github.com/halkeye/[email protected] | ||
/home/runner/go/bin/helm-repo-html | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v1 | ||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./ | ||
destination: ./_site | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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,8 @@ | ||
# local downloaded chart compressed files | ||
/**/charts/*.tgz | ||
|
||
# local temporary files | ||
temp*.yaml | ||
temp.sh | ||
/charts/temp/ | ||
values_*.y*ml |
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,7 @@ | ||
checks: | ||
addAllBuiltIn: true | ||
exclude: | ||
- "no-read-only-root-fs" | ||
- "unset-cpu-requirements" | ||
- "unset-memory-requirements" | ||
ignorePaths: [] |
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,18 @@ | ||
# Helm Charts | ||
|
||
## Catalog | ||
|
||
* [Cow Demo](cow-demo/README.md) | ||
* [Game 2048](game-2048/README.md) | ||
* [Let's Encrypt](letsencrypt/README.md) | ||
* [WordPress](wordpress/README.md) | ||
|
||
## Developer's guide | ||
|
||
```bash | ||
# lints a chart | ||
helm lint . | ||
|
||
# creates Kubernetes template file from chart (for review/comparison) | ||
helm template myname . -f values.yaml --namespace demo > temp.yaml | ||
``` |
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,10 @@ | ||
apiVersion: v2 | ||
name: cow-demo | ||
description: Helm chart for Cow Demo Application | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "2.0.0" | ||
home: https://github.com/SUSE/lab-setup/tree/main/charts/cow-demo | ||
maintainers: | ||
- name: devpro | ||
email: [email protected] |
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,25 @@ | ||
# Cow Demo Helm Chart | ||
|
||
This chart will install the "Cow Demo" web application in a Kubernetes cluster. | ||
|
||
## Quick start | ||
|
||
Install the app with default settings: | ||
|
||
```bash | ||
# adds the repo | ||
helm repo add devpro https://devpro.github.io/helm-charts | ||
helm repo update | ||
|
||
# installs the chart | ||
helm upgrade --install cow-demo devpro/cow-demo --namespace demo --create-namespace | ||
``` | ||
|
||
Look at [values.yaml](values.yaml) for the configuration. | ||
|
||
Clean-up: | ||
|
||
```bash | ||
helm delete cow-demo | ||
kubectl delete ns demo | ||
``` |
Empty file.
Empty file.
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 @@ | ||
{{- $name := $.Values.name -}} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ $name }} | ||
labels: | ||
app: {{ $name }} | ||
app.kubernetes.io/name: {{ $name }} | ||
spec: | ||
replicas: {{ $.Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app: {{ $name }} | ||
app.kubernetes.io/name: {{ $name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ $name }} | ||
app.kubernetes.io/name: {{ $name }} | ||
spec: | ||
containers: | ||
- name: webapp | ||
image: "{{ $.Values.image }}:{{ $.Values.tag }}" | ||
imagePullPolicy: Always | ||
env: | ||
- name: CONTAINER_COLOR | ||
value: {{ $.Values.pet.color }} | ||
- name: PETS | ||
value: {{ $.Values.pet.type }} | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} |
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 @@ | ||
{{- if $.Values.ingress.enabled -}} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ $.Values.name }} | ||
{{- with $.Values.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if $.Values.ingress.className }} | ||
ingressClassName: {{ $.Values.ingress.className }} | ||
{{- end }} | ||
rules: | ||
- {{- if $.Values.ingress.host }} | ||
host: {{ $.Values.ingress.host }} | ||
{{- end }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $.Values.name }} | ||
port: | ||
number: {{ $.Values.port }} | ||
{{- if $.Values.ingress.tls }} | ||
tls: | ||
- hosts: | ||
- {{ $.Values.ingress.host | quote }} | ||
secretName: {{ $.Values.ingress.tls.secretName }} | ||
{{- end }} | ||
{{- end }} |
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 @@ | ||
{{- $name := $.Values.name -}} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ $name }} | ||
labels: | ||
app: {{ $name }} | ||
app.kubernetes.io/name: {{ $name }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: {{ $name }} | ||
app.kubernetes.io/name: {{ $name }} | ||
ports: | ||
- name: http | ||
port: {{ $.Values.port }} | ||
protocol: TCP | ||
targetPort: 8080 |
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,27 @@ | ||
name: cow-demo | ||
image: devprofr/cow-demo | ||
tag: 1.0.8830193847 | ||
replicaCount: 2 | ||
port: 80 | ||
ingress: | ||
enabled: false | ||
className: "nginx" | ||
host: "" | ||
annotations: {} | ||
# nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | ||
# cert-manager.io/cluster-issuer: letsencrypt-prod | ||
tls: | ||
secretName: "cow-demo-tls" | ||
pet: | ||
# choice: cows, chameleons, cowmeleons | ||
type: cows | ||
# choice: red, orange, yellow, olive, green, teal, blue, violet, purple, pink, black | ||
color: blue | ||
resources: {} | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 64Mi |
Oops, something went wrong.