Skip to content

Commit 4314d27

Browse files
Convert to helm (#57)
* Convert to helm * Add charts releaser wf * Add small fixes * Add refactoring * Update readme * Update readme part 2
1 parent 4d1d7bc commit 4314d27

File tree

16 files changed

+547
-1
lines changed

16 files changed

+547
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
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: Run chart-releaser
23+
uses: helm/[email protected]
24+
env:
25+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
docker/
1010

1111
# build artifacts
12-
cluster-registry*
12+
/cluster-registry*
1313
kubeconfig
1414
.dynamodb
1515
.hack*

helm-charts/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Cluster Registry Client Chart
2+
3+
Helm chart for Cluster Registry Client.
4+
5+
## Prerequisites for installing the chart
6+
7+
**Notes**
8+
> Secret management must be handled by the user. Secrets must be created (either by kubectl or by a secret management tool) beforehand in order for the chart deployment to be successful.
9+
> This step is mandatory for the application to run succesfully.
10+
11+
Required secret name is `cluster-registry-aws` and required keys are: `AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, SQS_AWS_REGION, SQS_ENDPOINT, SQS_QUEUE_NAME`
12+
13+
Example of a secret name and corresponding required keys (can also be found in [deployment.yaml](cluster-registry-client/templates/deployment.yaml) file):
14+
```yaml
15+
apiVersion: v1
16+
data:
17+
AWS_ACCESS_KEY_ID: <AWS_ACCESS_KEY_ID_VALUE>
18+
AWS_SECRET_ACCESS_KEY: <AWS_SECRET_ACCESS_KEY_VALUE>
19+
SQS_AWS_REGION: <SQS_AWS_REGION_VALUE>
20+
SQS_ENDPOINT: <SQS_ENDPOINT_VALUE>
21+
SQS_QUEUE_NAME: <SQS_QUEUE_NAME_VALUE>
22+
kind: Secret
23+
metadata:
24+
name: cluster-registry-aws
25+
namespace: <namespace>
26+
type: Opaque
27+
```
28+
29+
## Chart configuration
30+
To see a full list if configurable parameters, check the table generated in the [README.md](cluster-registry-client/README.md) file.
31+
32+
### Deploying the chart locally
33+
```bash
34+
helm install cluster-registry-client . --values values.yaml --namespace <namespace>
35+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v2
2+
name: cluster-registry-client
3+
description: Helm chart for Cluster Registry Client.
4+
type: application
5+
home: https://github.com/adobe/cluster-registry
6+
7+
maintainers:
8+
- name: aalexandru
9+
10+
- name: radu-catalina
11+
12+
13+
version: 0.1.0
14+
appVersion: "v1.4.0"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# cluster-registry-client
2+
3+
![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: v1.4.0](https://img.shields.io/badge/AppVersion-v1.4.0-informational?style=flat-square)
4+
5+
Helm chart for Cluster Registry Client.
6+
7+
**Homepage:** <https://github.com/adobe/cluster-registry>
8+
9+
## Maintainers
10+
11+
| Name | Email | Url |
12+
| ---- | ------ | --- |
13+
| aalexandru | <[email protected]> | |
14+
| radu-catalina | <[email protected]> | |
15+
16+
## Values
17+
18+
| Key | Type | Default | Description |
19+
|-----|------|---------|-------------|
20+
| clusterRegistryClient.alertmanagerWebhook.alertMap | list | `[]` | |
21+
| clusterRegistryClient.alertmanagerWebhook.bindAddress | string | `"0.0.0.0:9092"` | |
22+
| clusterRegistryClient.health.healthProbeBindAddress | string | `":8081"` | |
23+
| clusterRegistryClient.leaderElection.leaderElect | bool | `true` | |
24+
| clusterRegistryClient.leaderElection.resourceName | string | `"0c4967d2.registry.ethos.adobe.com"` | |
25+
| clusterRegistryClient.leaderElection.resourceNamespace | string | `"cluster-registry"` | |
26+
| clusterRegistryClient.metrics.bindAddress | string | `"0.0.0.0:9090"` | |
27+
| clusterRegistryClient.webhook.port | int | `9443` | |
28+
| fullnameOverride | string | `"cluster-registry-client"` | |
29+
| image.pullPolicy | string | `"IfNotPresent"` | |
30+
| image.registry | string | `"ghcr.io/adobe/cluster-registry-client"` | |
31+
| livenessProbe.httpGet.path | string | `"/healthz"` | |
32+
| livenessProbe.httpGet.port | int | `9091` | |
33+
| livenessProbe.initialDelaySeconds | int | `15` | |
34+
| livenessProbe.periodSeconds | int | `20` | |
35+
| nameOverride | string | `"cluster-registry-client"` | |
36+
| ports[0].containerPort | int | `9090` | |
37+
| ports[0].name | string | `"metrics"` | |
38+
| ports[1].containerPort | int | `9092` | |
39+
| ports[1].name | string | `"amwebhook"` | |
40+
| rbac.create | bool | `true` | |
41+
| rbac.nameSuffix | string | `"cluster-client"` | |
42+
| readinessProbe.httpGet.path | string | `"/readyz"` | |
43+
| readinessProbe.httpGet.port | int | `9091` | |
44+
| readinessProbe.initialDelaySeconds | int | `5` | |
45+
| readinessProbe.periodSeconds | int | `10` | |
46+
| replicaCount | int | `2` | |
47+
| resources.limits.cpu | string | `"200m"` | |
48+
| resources.limits.memory | string | `"400Mi"` | |
49+
| resources.requests.cpu | string | `"100m"` | |
50+
| resources.requests.memory | string | `"200Mi"` | |
51+
| serviceAccount.create | bool | `true` | |
52+
| serviceAccount.name | string | `"cluster-registry-client"` | |
53+
| terminationGracePeriodSeconds | int | `10` | |
54+
55+
----------------------------------------------
56+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "cluster-registry-client.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "cluster-registry-client.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "cluster-registry-client.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "cluster-registry-client.labels" -}}
37+
helm.sh/chart: {{ include "cluster-registry-client.chart" . }}
38+
{{ include "cluster-registry-client.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{ include "cluster-registry-client.appLabels" . }}
44+
{{ include "cluster-registry-client.componentLabels" . }}
45+
{{- end }}
46+
47+
{{/*
48+
Selector labels
49+
*/}}
50+
{{- define "cluster-registry-client.selectorLabels" -}}
51+
app.kubernetes.io/name: {{ include "cluster-registry-client.name" . }}
52+
app.kubernetes.io/instance: {{ .Release.Name }}
53+
{{- end }}
54+
55+
{{/*
56+
Cluster Registry client application label
57+
*/}}
58+
{{- define "cluster-registry-client.appLabels" -}}
59+
app: cluster-registry-client
60+
{{- end }}
61+
62+
{{/*
63+
Cluster Registry component label
64+
*/}}
65+
{{- define "cluster-registry-client.componentLabels" -}}
66+
component: cluster-registry
67+
{{- end }}
68+
69+
{{/*
70+
Create the name of the service account to use
71+
*/}}
72+
{{- define "cluster-registry-client.serviceAccountName" -}}
73+
{{- if .Values.serviceAccount.create }}
74+
{{- default (include "cluster-registry-client.fullname" .) .Values.serviceAccount.name }}
75+
{{- else }}
76+
{{- default "default" .Values.serviceAccount.name }}
77+
{{- end }}
78+
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.clusterRegistryClient }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: "client-config"
6+
labels:
7+
{{- include "cluster-registry-client.labels" . | nindent 4 }}
8+
data:
9+
config.yaml: |-
10+
apiVersion: config.registry.ethos.adobe.com/v1
11+
kind: ClientConfig
12+
health:
13+
healthProbeBindAddress: {{ .Values.clusterRegistryClient.health.healthProbeBindAddress }}
14+
metrics:
15+
bindAddress: {{ .Values.clusterRegistryClient.metrics.bindAddress }}
16+
webhook:
17+
port: {{ .Values.clusterRegistryClient.webhook.port }}
18+
leaderElection:
19+
leaderElect: {{ .Values.clusterRegistryClient.leaderElection.leaderElect }}
20+
resourceNamespace: {{ .Release.Namespace }}
21+
resourceName: {{ .Values.clusterRegistryClient.leaderElection.resourceName }}
22+
namespace: {{ .Release.Namespace }}
23+
alertmanagerWebhook:
24+
bindAddress: {{ .Values.clusterRegistryClient.alertmanagerWebhook.bindAddress }}
25+
{{- if gt (len .Values.clusterRegistryClient.alertmanagerWebhook.alertMap) 0 }}
26+
alertMap:
27+
{{- range $_, $am := .Values.clusterRegistryClient.alertmanagerWebhook.alertMap }}
28+
- alertName: {{ $am.alertName }}
29+
onFiring:
30+
{{- toYaml $am.onFiring | nindent 12 }}
31+
onResolved:
32+
{{- toYaml $am.onResolved | nindent 12 }}
33+
{{- end }}
34+
{{- else }}
35+
alertMap: []
36+
{{- end }}
37+
{{- end }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels: {{- include "cluster-registry-client.labels" . | nindent 4 }}
5+
name: {{ include "cluster-registry-client.fullname" . }}
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
replicas: {{ .Values.replicaCount | required ".Values.replicaCount is required" }}
9+
selector:
10+
matchLabels:
11+
app: cluster-registry-client
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "cluster-registry-client.appLabels" . | nindent 8 }}
16+
annotations:
17+
kubectl.kubernetes.io/default-container: manager
18+
spec:
19+
containers:
20+
- args:
21+
- --leader-elect
22+
- --config=config.yaml
23+
command:
24+
- /bin/client
25+
image: "{{ .Values.image.registry }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
26+
imagePullPolicy: {{ .Values.image.pullPolicy }}
27+
volumeMounts:
28+
- name: client-config
29+
mountPath: /config.yaml
30+
subPath: config.yaml
31+
ports:
32+
{{- toYaml .Values.ports | nindent 12 }}
33+
env:
34+
- name: AWS_ACCESS_KEY_ID
35+
valueFrom:
36+
secretKeyRef:
37+
key: AWS_ACCESS_KEY_ID
38+
name: cluster-registry-aws
39+
- name: AWS_SECRET_ACCESS_KEY
40+
valueFrom:
41+
secretKeyRef:
42+
key: AWS_SECRET_ACCESS_KEY
43+
name: cluster-registry-aws
44+
- name: SQS_ENDPOINT
45+
valueFrom:
46+
secretKeyRef:
47+
key: SQS_ENDPOINT
48+
name: cluster-registry-aws
49+
- name: SQS_QUEUE_NAME
50+
valueFrom:
51+
secretKeyRef:
52+
key: SQS_QUEUE_NAME
53+
name: cluster-registry-aws
54+
- name: AWS_REGION
55+
valueFrom:
56+
secretKeyRef:
57+
key: SQS_AWS_REGION
58+
name: cluster-registry-aws
59+
- name: SQS_AWS_REGION
60+
valueFrom:
61+
secretKeyRef:
62+
key: SQS_AWS_REGION
63+
name: cluster-registry-aws
64+
{{- if .Values.livenessProbe }}
65+
livenessProbe:
66+
{{- toYaml .Values.livenessProbe | nindent 12 }}
67+
{{- end }}
68+
{{- if .Values.readinessProbe }}
69+
readinessProbe:
70+
{{- toYaml .Values.readinessProbe | nindent 12 }}
71+
{{- end }}
72+
{{- if .Values.resources }}
73+
resources:
74+
{{- toYaml .Values.resources | nindent 12 }}
75+
{{- end }}
76+
name: manager
77+
securityContext:
78+
allowPrivilegeEscalation: false
79+
volumes:
80+
- name: client-config
81+
configMap:
82+
name: client-config
83+
serviceAccountName: {{ include "cluster-registry-client.serviceAccountName" . }}
84+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds | required ".Values.terminationGracePeriodSeconds is required" }}

0 commit comments

Comments
 (0)