-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from kahootali/add-helm-chart
Add helm chart for operator based implementation
- Loading branch information
Showing
14 changed files
with
502 additions
and
0 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,12 @@ | ||
apiVersion: v1 | ||
name: ingressmonitorcontroller | ||
version: v2.0.15 | ||
description: IngressMonitorController Operator chart that runs on kubernetes | ||
keywords: | ||
- IngressMonitorController | ||
- IngressMonitorController Operator | ||
- kubernetes | ||
home: https://github.com/stakater/IngressMonitorController | ||
icon: https://raw.githubusercontent.com/stakater/IngressMonitorController/master/assets/web/IMC-round-100px.png | ||
sources: | ||
- https://github.com/stakater/IngressMonitorController |
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,53 @@ | ||
# IngressMonitorController Helm Chart | ||
|
||
|
||
Helm chart for the new IngressMonitorController operator that runs on kubernetes | ||
|
||
This chart supports v2.x.x as IMC has been shifted to operator from that version. For controller based approach, refer to [release-v1](https://github.com/stakater/IngressMonitorController/tree/release-v1/deployments/kubernetes) | ||
|
||
Source code can be found [here](https://github.com/stakater/IngressMonitorController) | ||
|
||
## Installation | ||
|
||
To install IMC helm chart run the following | ||
|
||
```sh | ||
# Install CRDs | ||
kubectl apply -f https://raw.githubusercontent.com/stakater/IngressMonitorController/master/deploy/crds/endpointmonitor.stakater.com_endpointmonitors_crd.yaml | ||
|
||
# Install Chart | ||
helm repo add stakater https://stakater.github.io/stakater-charts | ||
|
||
helm repo update | ||
|
||
helm install stakater/ingressmonitorcontroller | ||
``` | ||
|
||
## Chart Values | ||
|
||
| Key | Default | Description | | ||
|-----|---------|-------------| | ||
| global.labels | `` | Labels to be added to all components | | ||
| watchNamespaces | `` | comma separated namespace names, set empty to watch all namespaces | | ||
| useFullName | `false` | | | ||
| deployment.annotations | `"configmap.reloader.stakater.com/reload": "ingressmonitorcontroller"` | Additional annotations on deployment | | ||
| deployment.labels | `` | Additional labels on deployment | | ||
| deployment.replicas | `1` | Replicas for deployment | | ||
| deployment.revisionHistoryLimit | `2` | Limit on rollout history | | ||
| deployment.operatorName | `ingressmonitorcontroller` | | | ||
| deployment.logLevel | `info` | Log Level | | ||
| deployment.logFormat | `text` | Formatting logs | | ||
| deployment.image.name | `"stakater/ingressmonitorcontroller"` | Image repository | | ||
| deployment.image.tag | `LATEST_CHART_VERSION` | Tag of the Image | | ||
| deployment.image.pullPolicy | `Always` | Pull policy for the image | | ||
| rbac.create | `true` | Whether to create RBAC (Role/Cluster & RoleBinding/ClusterRoleBinding) | | ||
| rbac.serviceAccount.create | `true` | Whether to create serviceAccount | | ||
| rbac.serviceAccount.name | `""` | Name for ServiceAccount, if empty the default chart name will be used | | ||
| rbac.serviceAccount.labels | `{}` | Additional labels on ServiceAccount | | ||
| rbac.serviceAccount.annotations | `{}` | Additional annotations on ServiceAccount| | ||
| secret.useExisting | `false` | Whether to use an existing secret, if true, this chart will not create secret | | ||
| secret.name | `""` | Name used for secret, either already existing secret or created from this chart, if empty the default chart name will be used | | ||
| secret.labels | `{}` | Additional labels on Secret | | ||
| secret.annotations | `{}` | Additional annotations on Secret| | ||
| secret.data."config.yaml" | `"providers:\n- name: UptimeRobot\n apiKey: your-api-key\n apiURL: https://google.com\n alertContacts: some-alert-contacts\nenableMonitorDeletion: true\nmonitorNameTemplate: \"{{.Namespace}}-{{.IngressName}}\"\n# how often (in seconds) monitors should be synced to their Kubernetes resources (0 = disabled)\nresyncPeriod: 0\n# creationDelay is a duration string to add a delay before creating new monitor (e.g., to allow DNS to catch up first)\n# https://golang.org/pkg/time/#ParseDuration\ncreationDelay: 0"` | Config for secret used for IMC | | ||
|
37 changes: 37 additions & 0 deletions
37
deploy/chart/ingressmonitorcontroller/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,37 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- if .Values.useFullName -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" | lower -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define the name of the service account to use | ||
*/}} | ||
{{- define "serviceAccountName" -}} | ||
{{- if .Values.rbac.serviceAccount.create -}} | ||
{{ default (include "name" .) .Values.rbac.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.rbac.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define the default labels for the resources | ||
*/}} | ||
{{- define "labels" -}} | ||
provider: stakater | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: {{ .Release.Name | quote }} | ||
heritage: {{ .Release.Service | quote }} | ||
version: {{ .Values.deployment.image.tag }} | ||
{{- if .Values.global.labels }} | ||
{{ toYaml .Values.global.labels }} | ||
{{- end }} | ||
{{- end -}} |
82 changes: 82 additions & 0 deletions
82
deploy/chart/ingressmonitorcontroller/templates/clusterrole.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,82 @@ | ||
{{- if and ( .Values.rbac.create ) (eq .Values.watchNamespaces "") }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ template "name" . }}-cluster-role | ||
labels: | ||
{{ include "labels" $ | indent 4 }} | ||
rules: | ||
- apiGroups: | ||
- "" | ||
- "extensions" | ||
- "route.openshift.io" | ||
resources: | ||
- ingresses | ||
- routes | ||
- secrets | ||
verbs: | ||
- list | ||
- get | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
- services | ||
- configmaps | ||
- services/finalizers | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
- daemonsets | ||
- replicasets | ||
- statefulsets | ||
verbs: | ||
- "list" | ||
- "get" | ||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
verbs: | ||
- get | ||
- create | ||
- list | ||
- apiGroups: | ||
- apps | ||
resourceNames: | ||
- ingressmonitorcontroller | ||
resources: | ||
- deployments/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- endpointmonitor.stakater.com | ||
resources: | ||
- '*' | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
{{- end }} |
16 changes: 16 additions & 0 deletions
16
deploy/chart/ingressmonitorcontroller/templates/clusterrolebinding.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 @@ | ||
{{- if and ( .Values.rbac.create ) (eq .Values.watchNamespaces "") }} | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ template "name" . }}-role-binding | ||
labels: | ||
{{ include "labels" $ | indent 4 }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ template "name" . }}-cluster--role | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} |
66 changes: 66 additions & 0 deletions
66
deploy/chart/ingressmonitorcontroller/templates/deployment.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,66 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
{{- if .Values.deployment.annotations }} | ||
{{ toYaml .Values.deployment.annotations | indent 4 }} | ||
{{- end }} | ||
labels: | ||
{{ include "labels" $ | indent 4 }} | ||
{{- if .Values.deployment.labels }} | ||
{{ toYaml .Values.deployment.labels | indent 4 }} | ||
{{- end }} | ||
name: {{ template "name" . }} | ||
spec: | ||
replicas: {{ .Values.deployment.replicas }} | ||
revisionHistoryLimit: {{ .Values.deployment.revisionHistoryLimit }} | ||
selector: | ||
matchLabels: | ||
{{ include "labels" $ | indent 6 }} | ||
{{- if .Values.deployment.labels }} | ||
{{ toYaml .Values.deployment.labels | indent 6 }} | ||
{{- end }} | ||
template: | ||
metadata: | ||
labels: | ||
{{ include "labels" $ | indent 8 }} | ||
{{- if .Values.deployment.labels }} | ||
{{ toYaml .Values.deployment.labels | indent 8 }} | ||
{{- end }} | ||
spec: | ||
containers: | ||
- env: | ||
- name: WATCH_NAMESPACE | ||
{{- if .Values.watchNamespaces }} | ||
value: {{ .Values.watchNamespaces | quote }} | ||
{{- else }} | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
{{- end }} | ||
- name: POD_NAME | ||
{{- if .Values.deployment.podName }} | ||
value: {{ .Values.deployment.podName | quote }} | ||
{{- else }} | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
{{- end }} | ||
- name: CONFIG_SECRET_NAME | ||
{{- if .Values.secret.name }} | ||
value: {{ .Values.secret.name | quote }} | ||
{{- else }} | ||
value: {{ template "name" . }} | ||
{{- end }} | ||
- name: OPERATOR_NAME | ||
value: {{ .Values.deployment.operatorName | quote }} | ||
- name: LOG_LEVEL | ||
value: {{ .Values.deployment.logLevel | quote }} | ||
- name: LOG_FORMAT | ||
value: {{ .Values.deployment.logFormat | quote }} | ||
image: "{{ .Values.deployment.image.name }}:{{ .Values.deployment.image.tag }}" | ||
command: | ||
- IngressMonitorController | ||
imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} | ||
name: {{ template "name" . }} | ||
serviceAccountName: {{ template "serviceAccountName" . }} |
Oops, something went wrong.