Skip to content

Commit

Permalink
Merge pull request #23 from nirmata/helm-release
Browse files Browse the repository at this point in the history
feat: add helm release
  • Loading branch information
pns-nirmata authored Nov 30, 2022
2 parents 4cc4596 + deeb1eb commit 54a966a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
run: git fetch --prune --unshallow
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0
- uses: actions/setup-python@v4
with:
python-version: 3.7
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Install Helm
uses: azure/setup-helm@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
Expand All @@ -31,3 +33,21 @@ jobs:
set -e
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
IMG="$IMG_REPOSITORY:${{ github.ref_name }}" make docker-buildx
- name: Create charts tmp directory
run: |
mkdir charts-tmp
cp -a charts/kyverno-aws-adapter charts-tmp/kyverno-aws-adapter
- name: Package charts
run: |
for dir in `find charts-tmp -maxdepth 1 -mindepth 1 -type d -print`; do
chart=${dir##*/}
echo "Found chart: ${chart}"
helm package charts-tmp/${chart} --destination --version ${{ github.ref_name }} --app-version ${{ github.ref_name }} .helm-dist
done
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: .helm-dist
skip_packaging: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4 changes: 2 additions & 2 deletions charts/kyverno-aws-adapter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: kyverno-aws-adapter
description: Helm chart for the Kyverno AWS Adapter
type: application
version: 0.1.0
appVersion: 0.1.0
version: v0.0.1
appVersion: v0.0.1
keywords:
- kubernetes
- nirmata
Expand Down
4 changes: 2 additions & 2 deletions charts/kyverno-aws-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Helm chart for the Kyverno AWS Adapter

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: v0.0.1](https://img.shields.io/badge/Version-v0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)

## Description

Expand Down Expand Up @@ -40,7 +40,7 @@ You’ll need an [EKS](https://aws.amazon.com/eks/) cluster to run against.
| rbac.serviceAccount.name | string | `nil` | Service account name, you MUST provide one when `rbac.create` is set to `false` |
| image.repository | string | `"ghcr.io/nirmata/kyverno-aws-adapter"` | Image repository |
| image.pullPolicy | string | `"Always"` | Image pull policy |
| image.tag | string | `"latest"` | Image tag |
| image.tag | string | `nil` | Image tag (defaults to chart app version) |

## IAM Role for Service Account

Expand Down
4 changes: 4 additions & 0 deletions charts/kyverno-aws-adapter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ Generate the dockerconfigjson value
{{- $user_pwd_hashed := printf "%s:%s" .Values.registryConfig.username .Values.registryConfig.password | b64enc }}
{{- printf "{\"auths\":{\"ghcr.io\":{\"auth\":\"%s\"}}}" $user_pwd_hashed | b64enc }}
{{- end }}

{{- define "kyverno-aws-adapter.image" -}}
{{ printf "%s:%s" (required "An image repository is required" .Values.image.repository) (default .Chart.AppVersion .Values.image.tag) }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/kyverno-aws-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
containers:
- command:
- /manager
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
image: {{ include "kyverno-aws-adapter.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: manager
{{- if .Values.pollInterval }}
Expand Down
4 changes: 2 additions & 2 deletions charts/kyverno-aws-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ image:
repository: ghcr.io/nirmata/kyverno-aws-adapter
# -- Image pull policy
pullPolicy: Always
# -- Image tag
tag: latest
# -- Image tag (defaults to chart app version)
tag:

0 comments on commit 54a966a

Please sign in to comment.