-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
fe94995
commit afcc2f8
Showing
22 changed files
with
30,051 additions
and
5 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
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
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,9 @@ | ||
apiVersion: v2 | ||
appVersion: 2.2.21 | ||
description: A Helm chart for EMQX Operator Controller | ||
name: emqx-operator | ||
sources: | ||
- https://github.com/emqx/emqx-operator/tree/main/deploy/charts/emqx-operator | ||
- https://github.com/emqx/emqx | ||
type: application | ||
version: 2.2.21 |
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,67 @@ | ||
# EMQX Operator | ||
|
||
The EMQX Operator provides [Kubernetes](https://kubernetes.io/) native deployment and management of [EMQX](https://www.emqx.io/) including EMQX Broker and EMQX Enterprise. The purpose of this project is to simplify and automate the configuration of the EMQX cluster. | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `emqx-operator`: | ||
|
||
```console | ||
## Add the EMQX Helm repository | ||
$ helm repo add emqx https://repos.emqx.io/charts | ||
$ helm repo update | ||
|
||
## Install the emqx-operator helm chart | ||
$ helm install emqx-operator emqx/emqx-operator \ | ||
--namespace emqx-operator-system \ | ||
--create-namespace | ||
``` | ||
|
||
> **Tip**: List all releases using `helm ls -A` | ||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `emqx-operator` deployment: | ||
|
||
```console | ||
$ helm delete emqx-operator -n emqx-operator-system | ||
``` | ||
|
||
## Configuration | ||
|
||
The following table lists the configurable parameters of the cert-manager chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
| --------- | ----------- | ------- | | ||
| `skipCRDs` | If `true`, skips installing CRDs | `false` | | ||
| `development` | Development configures the logger to use a Zap development config (stacktraces on warnings, no sampling), otherwise a Zap production config will be used (stacktraces on errors, sampling). | `false` | | ||
| `image.repository` | Image repository | `emqx/emqx-operator-controller` | | ||
| `image.tag` | Image tag | `{{RELEASE_VERSION}}` | | ||
| `image.pullPolicy` | Image pull policy | `IfNotPresent` | | ||
| `imagePullSecrets` | Image pull secrets| `[]` | | ||
| `nameOverride` | Override chart name | `""` | | ||
| `fullnameOverride` | Default fully qualified app name. | `""` | | ||
| `replicaCount` | Number of EMQX operator replicas | `1` | | ||
| `revisionHistoryLimit` | The number of old history to retain to allow rollback | `1` | | ||
| `serviceAccount.create` | If `true`, create a new service account | `true` | | ||
| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | | ||
| `serviceAccount.annotations` | Annotations to add to the service account | | | ||
| `resources` | CPU/memory resource requests/limits | `{}` | | ||
| `nodeSelector` | Node labels for pod assignment | `{}` | | ||
| `affinity` | Node affinity for pod assignment | `{}` | | ||
| `tolerations` | Node tolerations for pod assignment | `[]` | | ||
| `cert-manager.enable` | Using [cert manager](https://github.com/jetstack/cert-manager) for provisioning the certificates for the webhook server. You can follow [the cert manager documentation](https://cert-manager.io/docs/installation/) to install it. | `false` | | ||
| `cert-manager.secretName` | TLS secret for certificates for the `${NAME}-webhook-service.${NAMESPACE}.svc` | `""` | | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. | ||
|
||
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, | ||
|
||
```console | ||
$ helm install emqx-operator -f values.yaml . | ||
``` | ||
> **Tip**: You can use the default [values.yaml](https://github.com/emqx/emqx-operator/tree/main/deploy/charts/emqx-operator/values.yaml) | ||
## Contributing | ||
|
||
This chart is maintained at [github.com/emqx/emqx-operator](https://github.com/emqx/emqx-operator/tree/main/deploy/charts/emqx-operator). |
5 changes: 5 additions & 0 deletions
5
charts/fogcloud-charts/operator/emqx-operator/templates/NOTES.txt
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,5 @@ | ||
EMQX Operator Controller {{ .Chart.AppVersion }} has been deployed successfully! | ||
|
||
Now you can create the EMQX Custom Resource file and deploy it. | ||
|
||
Where to get help: https://github.com/emqx/emqx-operator/issues |
63 changes: 63 additions & 0 deletions
63
charts/fogcloud-charts/operator/emqx-operator/templates/_helpers.tpl
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,63 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "emqx-operator.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
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 "emqx-operator.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "emqx-operator.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "emqx-operator.labels" -}} | ||
helm.sh/chart: {{ include "emqx-operator.chart" . }} | ||
{{ include "emqx-operator.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "emqx-operator.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "emqx-operator.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "emqx-operator.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "emqx-operator.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
24 changes: 24 additions & 0 deletions
24
charts/fogcloud-charts/operator/emqx-operator/templates/cert-manager.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,24 @@ | ||
{{- if (index .Values "cert-manager" "enable") }} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ include "emqx-operator.fullname" . }}-selfsigned-issuer | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selfSigned: {} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ include "emqx-operator.fullname" . }}-serving-cert | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
dnsNames: | ||
- {{ include "emqx-operator.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc | ||
- {{ include "emqx-operator.fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc.cluster.local | ||
issuerRef: | ||
kind: Issuer | ||
name: {{ include "emqx-operator.fullname" . }}-selfsigned-issuer | ||
secretName: {{ index .Values "cert-manager" "secretName" | default (printf "%s-webhook-server-cert" (include "emqx-operator.fullname" .)) }} | ||
{{- end }} |
55 changes: 55 additions & 0 deletions
55
...loud-charts/operator/emqx-operator/templates/controller-manager-leader-election-role.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,55 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "emqx-operator.fullname" . }}-leader-election-rolebinding | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ include "emqx-operator.fullname" . }}-leader-election-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "emqx-operator.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "emqx-operator.fullname" . }}-leader-election-role | ||
namespace: {{ .Release.Namespace }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
{{- end }} |
16 changes: 16 additions & 0 deletions
16
.../fogcloud-charts/operator/emqx-operator/templates/controller-manager-metrics-service.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,16 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
control-plane: controller-manager | ||
name: {{ include "emqx-operator.fullname" . }}-controller-manager-metrics-service | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
ports: | ||
- name: metrics | ||
port: 8080 | ||
targetPort: metrics | ||
selector: | ||
control-plane: controller-manager | ||
{{- include "emqx-operator.selectorLabels" . | nindent 4 }} |
Oops, something went wrong.