Skip to content

Commit 79fbae9

Browse files
authored
Merge pull request #12 from kir4h/develop
v1.2.0
2 parents e109bfc + c3aa346 commit 79fbae9

File tree

14 files changed

+152
-100
lines changed

14 files changed

+152
-100
lines changed

.circleci/config.yml

-18
This file was deleted.

.github/workflows/lint-test.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v1
16+
with:
17+
version: v3.4.1
18+
19+
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
20+
# yamllint (https://github.com/adrienverge/yamllint) which require Python
21+
- name: Set up Python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: 3.7
25+
26+
- name: Set up chart-testing
27+
uses: helm/[email protected]
28+
with:
29+
version: v3.3.0
30+
31+
- name: Run chart-testing (list-changed)
32+
id: list-changed
33+
run: |
34+
changed=$(ct list-changed --config ct.yaml)
35+
if [[ -n "$changed" ]]; then
36+
echo "::set-output name=changed::true"
37+
fi
38+
39+
- name: Run chart-testing (lint)
40+
run: ct lint --config ct.yaml
41+
42+
- name: Create kind cluster
43+
uses: helm/[email protected]
44+
if: steps.list-changed.outputs.changed == 'true'
45+
46+
- name: Run chart-testing (install)
47+
run: ct install --config ct.yaml

.github/workflows/release.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Configure Git
18+
run: |
19+
git config user.name "$GITHUB_ACTOR"
20+
git config user.email "[email protected]"
21+
22+
- name: Install Helm
23+
uses: azure/setup-helm@v1
24+
with:
25+
version: v3.4.1
26+
27+
- name: Add dependency chart repos
28+
run: |
29+
helm repo add bitnami https://charts.bitnami.com/bitnami
30+
31+
- name: Run chart-releaser
32+
uses: helm/[email protected]
33+
with:
34+
charts_dir: charts
35+
config: cr.yaml
36+
env:
37+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ since Helm hub was announced having separate repositories aggregated by the hub
1010

1111
## Acknowledgements
1212

13-
[Hidetake Iwata](https://github.com/int128) since I've borrowed his `publish.sh`and `.circleci/config.yml` to have
14-
a functional initial version
13+
[charts-repo-actions-demo](https://github.com/helm/charts-repo-actions-demo), used to produce this CI flow

charts/registry-creds/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
appVersion: "1.9"
33
description: A Helm chart for registry creds
44
name: registry-creds
5-
version: 1.1.3
5+
version: 1.2.0
66
home: https://hub.docker.com/r/upmcenterprises/registry-creds
77
sources:
88
- https://github.com/upmc-enterprises/registry-creds

charts/registry-creds/README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ helm install --name registry-creds --set dpr.enabled=true --set-string dpr.user=
4747

4848
#### From AWS
4949

50-
Ensure your EC2 instances have the appropriate permissions as described in
50+
Ensure your EC2 instances have the appropriate permissions as described in
5151
[registry-creds](https://github.com/upmc-enterprises/registry-creds) documentation.
5252

5353
```console
@@ -69,7 +69,7 @@ Create a `custom-values.yaml` file:
6969

7070
```yaml
7171
gcr:
72-
enabled: false
72+
enabled: false
7373
applicationDefaultCredentialsJson: |
7474
{
7575
"client_id": "myID",
@@ -148,6 +148,11 @@ Parameter | Description | Default
148148
`gcr.existingSecretName` | defines an existing secret (in kube-system namespace) containing the credentials| `""`
149149
`gcr.applicationDefaultCredentialsJson` | JSON representing google cloud credentials. Only applicable if gcr.existingSecretName is empty | `""`
150150
`gcr.url` | URL for google container registry. Only applicable if gcr.existingSecretName is empty | `"https://gcr.io"`
151+
`acr.enabled` | enables the injection of azure container registry credentials | `false`
152+
`acr.existingSecretName` | defines an existing secret (in kube-system namespace) containing the credentials| `""`
153+
`acr.url` | defines the url of azure container registry| Only applicable if acr.existingSecretName is empty | `""`
154+
`acr.clientId` | is the client id used to access azure container registry | Only applicable if acr.existingSecretName is empty | `""`
155+
`acr.password` | is the client password used to access azure container registry | Only applicable if acr.existingSecretName is empty | `""`
151156
`rbac.enabled` | enables the usage of RBAC for registry-creds (needed for clusters with RBAC enabled) | `true`
152157
`rbac.existingServiceAccountName` | name of an existing service account to be used for RBAC permissions. If not defined a new service account will be created by the chart | `""`
153158
`resources.limits`.memory | memory resource limit | `"100Mi"`

charts/registry-creds/templates/NOTES.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ registry-creds is now installed on your Kubernetes cluster
33
If everything is ok, you should see one or more secrets (depending on the enabled types) created on every existing
44
namespace (except for kube-system):
55

6-
kubectl get secret | egrep "(dpr|ecr|gcr)-secret"
6+
kubectl get secret | egrep "(dpr|ecr|gcr|acr)-secret"

charts/registry-creds/templates/deployment.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ spec:
8989
name: {{ default (include "registry-creds.name" . | printf "%s-dpr") .Values.dpr.existingSecretName }}
9090
key: DOCKER_PRIVATE_REGISTRY_USER
9191
{{- end }}
92+
{{- if .Values.acr.enabled }}
93+
- name: ACR_URL
94+
valueFrom:
95+
secretKeyRef:
96+
name: {{ default (include "registry-creds.name" . | printf "%s-acr") .Values.acr.existingSecretName }}
97+
key: ACR_URL
98+
- name: ACR_CLIENT_ID
99+
valueFrom:
100+
secretKeyRef:
101+
name: {{ default (include "registry-creds.name" . | printf "%s-acr") .Values.acr.existingSecretName }}
102+
key: ACR_CLIENT_ID
103+
- name: ACR_PASSWORD
104+
valueFrom:
105+
secretKeyRef:
106+
name: {{ default (include "registry-creds.name" . | printf "%s-acr") .Values.acr.existingSecretName }}
107+
key: ACR_PASSWORD
108+
{{- end }}
92109
{{- if .Values.gcr.enabled }}
93110
volumeMounts:
94111
- name: {{ template "registry-creds.name" . }}-gcr

charts/registry-creds/templates/rbac.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rules:
2727
- get
2828
- update
2929
---
30-
apiVersion: rbac.authorization.k8s.io/v1beta1
30+
apiVersion: rbac.authorization.k8s.io/v1
3131
kind: ClusterRoleBinding
3232
metadata:
3333
name: {{ template "registry-creds.name" . }}
@@ -45,4 +45,4 @@ kind: ServiceAccount
4545
metadata:
4646
name: {{ template "registry-creds.name" . }}
4747
namespace: kube-system
48-
{{- end }}
48+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if and .Values.acr.enabled (not .Values.acr.existingSecretName) }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ template "registry-creds.name" . }}-acr
6+
namespace: kube-system
7+
labels:
8+
app: registry-creds
9+
cloud: acr
10+
data:
11+
ACR_URL: {{ .Values.acr.url | b64enc | quote }}
12+
ACR_CLIENT_ID: {{ .Values.acr.clientId | b64enc | quote }}
13+
ACR_PASSWORD: {{ .Values.acr.password | b64enc | quote }}
14+
type: Opaque
15+
{{- end }}

charts/registry-creds/values.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ replicaCount: 1
22

33
image:
44
name: "upmcenterprises/registry-creds"
5-
tag: "1.9"
5+
tag: "1.10"
66
pullPolicy: "IfNotPresent"
77

88
nameOverride: ""
@@ -51,6 +51,18 @@ gcr:
5151
# gcr.url is the URL for google container registry. Only applicable if gcr.existingSecretName is empty
5252
url: "https://gcr.io"
5353

54+
acr:
55+
# acr.enabled enables the injection of azure container registry credentials
56+
enabled: false
57+
# acr.existingSecretName defines an existing secret (in kube-system namespace) containing the credentials
58+
existingSecretName: ""
59+
# acr.url defines the url of azure container registry. Only applicable if acr.existingSecretName is empty
60+
url: ""
61+
# acr.clientId is the client id used to access azure container registry. Only applicable if acr.existingSecretName is empty
62+
clientId: ""
63+
# acr.password is the client password used to access azure container registry. Only applicable if acr.existingSecretName is empty
64+
password: ""
65+
5466
rbac:
5567
# rbac.enabled enables the usage of RBAC for registry-creds
5668
enabled: true

cr.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Set to true for GPG signing
2+
sign: false
3+
# UID of the GPG key to use
4+
key: Chart Releaser Test Key

ct.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See https://github.com/helm/chart-testing#configuration
2+
remote: origin
3+
chart-dirs:
4+
- charts
5+
chart-repos:
6+
- bitnami=https://charts.bitnami.com/bitnami
7+
helm-extra-args: --timeout 600s

publish.sh

-73
This file was deleted.

0 commit comments

Comments
 (0)