Skip to content

Commit

Permalink
rename charts (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoffm-aiven authored Sep 9, 2021
1 parent cebd8a7 commit a732abd
Show file tree
Hide file tree
Showing 25 changed files with 199 additions and 180 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Create kind cluster
uses: helm/[email protected]

- name: Install aiven-kubernetes-operator CRDs
run: helm install charts/aiven-kubernetes-operator-crds --generate-name
- name: Install aiven-operator CRDs
run: helm install charts/aiven-operator-crds --generate-name

- name: Test aiven-kubernetes-operator chart
run: ct install --charts charts/aiven-kubernetes-operator
- name: Test aiven-operator chart
run: ct install --charts charts/aiven-operator
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Aiven Helm Charts
# Aiven Charts

This repository contains official Helm charts that are maintained by [Aiven](https://aiven.io)

## Adding the repository

```bash
helm repo add aiven https://aiven-helm-charts.github.io && helm repo update
helm repo add aiven https://aiven-charts.github.io && helm repo update
```

## Installing a chart from the repository

### Installing the aiven-kubernetes-operator-crds chart
### Installing the aiven-operator-crds chart

```bash
helm install aiven/aiven-kubernetes-operator-crds --generate-name
helm install aiven/aiven-operator-crds --generate-name
```

### Installing the aiven-kubernetes-operator chart
### Installing the aiven-operator chart

Before installing the `aiven-kubernetes-operator` chart, please make sure to have the CRDs chart installed.
Before installing the `aiven-operator` chart, please make sure to have the CRDs chart installed.

Installation with webhooks enabled ( requires a cert-manager deployment in the cluster ):

```bash
helm install aiven/aiven-kubernetes-operator --generate-name
helm install aiven/aiven-operator --generate-name
```

Without webhooks enabled:

```bash
helm install aiven/aiven-kubernetes-operator --generate-name --set webhooks.enabled=false
helm install aiven/aiven-operator --generate-name --set webhooks.enabled=false
```
33 changes: 0 additions & 33 deletions charts/aiven-kubernetes-operator/templates/certificate.yaml

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions charts/aiven-kubernetes-operator/templates/service.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: aiven-kubernetes-operator-crds
description: A Helm chart to deploy the aiven k8s operator custom resource definitions
name: aiven-operator-crds
description: A Helm chart to deploy the aiven operator custom resource definitions
type: application
version: v0.1.0
appVersion: v0.0.1
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: aiven-kubernetes-operator
description: A Helm chart to deploy the aiven k8s operator
name: aiven-operator
description: A Helm chart to deploy the aiven operator
type: application
version: v0.1.0
appVersion: v0.0.1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "aiven-kubernetes-operator.name" -}}
{{- define "aiven-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "aiven-kubernetes-operator.namespace" -}}
{{- define "aiven-operator.namespace" -}}
{{- .Release.Namespace }}
{{- end }}

Expand All @@ -14,7 +14,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "aiven-kubernetes-operator.fullname" -}}
{{- define "aiven-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -30,16 +30,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "aiven-kubernetes-operator.chart" -}}
{{- define "aiven-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "aiven-kubernetes-operator.labels" -}}
helm.sh/chart: {{ include "aiven-kubernetes-operator.chart" . }}
{{ include "aiven-kubernetes-operator.selectorLabels" . }}
{{- define "aiven-operator.labels" -}}
helm.sh/chart: {{ include "aiven-operator.chart" . }}
{{ include "aiven-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -49,18 +49,18 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "aiven-kubernetes-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aiven-kubernetes-operator.name" . }}
{{- define "aiven-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "aiven-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
control-plane: controller-manager
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "aiven-kubernetes-operator.serviceAccountName" -}}
{{- define "aiven-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "aiven-kubernetes-operator.fullname" .) .Values.serviceAccount.name }}
{{- default (include "aiven-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand All @@ -69,6 +69,6 @@ Create the name of the service account to use
{{/*
Common annotation our custom resource
*/}}
{{- define "aiven-kubernetes-operator.ca_injection_annotation" -}}
cert-manager.io/inject-ca-from: {{ include "aiven-kubernetes-operator.namespace" . }}/webhook-server-cert
{{- define "aiven-operator.ca_injection_annotation" -}}
cert-manager.io/inject-ca-from: {{ include "aiven-operator.namespace" . }}/webhook-server-cert
{{- end }}
33 changes: 33 additions & 0 deletions charts/aiven-operator/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.webhooks.enabled }}

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "aiven-operator.fullname" . }}-webhook-certificate
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-operator.labels" . | nindent 4 }}
spec:
dnsNames:
- {{ include "aiven-operator.fullname" . }}-webhook-service.{{ include "aiven-operator.namespace" . }}.svc
- {{ include "aiven-operator.fullname" . }}-webhook-service.{{ include "aiven-operator.namespace" . }}.svc.cluster.local
issuerRef:
kind: Issuer
name: {{ include "aiven-operator.fullname" . }}-selfsigned-issuer
secretName: webhook-server-cert

---

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "aiven-operator.fullname" . }}-selfsigned-issuer
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-operator.labels" . | nindent 4 }}
spec:
selfSigned: {}

---

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "aiven-kubernetes-operator.fullname" . }}-role
namespace: {{ include "aiven-kubernetes-operator.namespace" . }}
name: {{ include "aiven-operator.fullname" . }}-role
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-kubernetes-operator.labels" . | nindent 4 }}
{{- include "aiven-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -81,6 +81,26 @@ rules:
- kafkaacls/status
verbs:
- get
- apiGroups:
- aiven.io
resources:
- kafkaconnectors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- aiven.io
resources:
- kafkaconnectors/status
verbs:
- get
- patch
- update
- apiGroups:
- aiven.io
resources:
Expand Down Expand Up @@ -268,4 +288,3 @@ rules:
- get
- list
- update

15 changes: 15 additions & 0 deletions charts/aiven-operator/templates/cluster_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "aiven-operator.fullname" . }}-rolebinding
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "aiven-operator.fullname" . }}-role
subjects:
- kind: ServiceAccount
name: default
namespace: {{ include "aiven-operator.namespace" . }}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "aiven-kubernetes-operator.fullname" . }}
namespace: {{ include "aiven-kubernetes-operator.namespace" . }}
name: {{ include "aiven-operator.fullname" . }}
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-kubernetes-operator.labels" . | nindent 4 }}
{{- include "aiven-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "aiven-kubernetes-operator.selectorLabels" . | nindent 6 }}
{{- include "aiven-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "aiven-kubernetes-operator.selectorLabels" . | nindent 8 }}
{{- include "aiven-operator.selectorLabels" . | nindent 8 }}
spec:
terminationGracePeriodSeconds: 10

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "aiven-kubernetes-operator.fullname" . }}-election-role
namespace: {{ include "aiven-kubernetes-operator.namespace" . }}
name: {{ include "aiven-operator.fullname" . }}-election-role
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-kubernetes-operator.labels" . | nindent 4 }}
{{- include "aiven-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down
15 changes: 15 additions & 0 deletions charts/aiven-operator/templates/election_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "aiven-operator.fullname" . }}-election-rolebinding
namespace: {{ include "aiven-operator.namespace" . }}
labels:
{{- include "aiven-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "aiven-operator.fullname" . }}-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: {{ include "aiven-operator.namespace" . }}
Loading

0 comments on commit a732abd

Please sign in to comment.