-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(kommander): Use thanos & karma source code as subcharts (#453)
- Loading branch information
1 parent
b6e53ee
commit 721d64e
Showing
27 changed files
with
704 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ maintainers: | |
- name: alejandroEsc | ||
- name: jimmidyson | ||
name: kommander | ||
version: 0.5.2 | ||
version: 0.5.3 |
Binary file not shown.
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,22 @@ | ||
# 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 | ||
*~ | ||
# 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: v1 | ||
appVersion: 1.0.0 | ||
description: Kommander Karma | ||
name: kommander-karma | ||
home: https://github.com/mesosphere/charts | ||
version: 0.3.8 | ||
maintainers: | ||
- name: branden | ||
- name: gracedo |
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,84 @@ | ||
# Kommander Karma Helm chart | ||
|
||
This chart deploys [Karma](https://github.com/prymitive/karma) configured for Kommander, along with supporting resources and addons. | ||
This chart is intended to be used only as a subchart of the `kommander` chart. | ||
|
||
All the supported values and their defaults are listed below: | ||
|
||
```yaml | ||
# Internal address for the cluster's alertmanager. | ||
# alertmanagerAddress: "HOST:PORT" | ||
alertmanagerAddress: "" | ||
# Kommander service account used to delete the karma configmap | ||
kommanderServiceAccount: kommander-kubeaddons | ||
# Name of the karma configmap | ||
kommanderKarmaConfigMap: kommander-kubeaddons-config | ||
|
||
federate: | ||
addons: true | ||
systemNamespace: | ||
name: kommander-system | ||
|
||
karma: | ||
service: | ||
labels: | ||
servicemonitor.kubeaddons.mesosphere.io/path: "kommander__monitoring__karma__metrics" | ||
|
||
ingress: | ||
enabled: true | ||
annotations: | ||
kubernetes.io/ingress.class: "traefik" | ||
traefik.ingress.kubernetes.io/auth-response-headers: "X-Forwarded-User" | ||
traefik.ingress.kubernetes.io/auth-type: "forward" | ||
traefik.ingress.kubernetes.io/auth-url: "http://traefik-forward-auth-kubeaddons.kubeaddons.svc.cluster.local:4181/" | ||
traefik.ingress.kubernetes.io/priority: "2" | ||
path: "/ops/portal/kommander/monitoring/karma" | ||
hosts: | ||
- "" | ||
|
||
livenessProbe: | ||
delay: 5 | ||
period: 5 | ||
path: /ops/portal/kommander/monitoring/karma/ | ||
|
||
configMap: | ||
enabled: true | ||
rawConfig: | ||
alertmanager: | ||
interval: 30s | ||
servers: | ||
# Karma won't start without at least one configured alertmanager. We include a placeholder so that Karma will | ||
# successfully start. The placeholder URI's hostname should not resolve. This placeholder will be removed | ||
# once the corresponding controller discovers a managed cluster and updates this configuration with its | ||
# alertmanager. | ||
- name: placeholder | ||
uri: https://placeholder.invalid | ||
annotations: | ||
default: | ||
hidden: false | ||
hidden: | ||
- help | ||
visible: [] | ||
filters: | ||
default: [] | ||
labels: | ||
color: | ||
static: | ||
- job | ||
unique: | ||
- cluster | ||
- instance | ||
- "@receiver" | ||
keep: [] | ||
strip: [] | ||
listen: | ||
address: "0.0.0.0" | ||
port: 8080 | ||
prefix: /ops/portal/kommander/monitoring/karma/ | ||
log: | ||
config: true | ||
level: info | ||
|
||
certSecretNames: | ||
- kommander-karma-client-tls | ||
``` |
Binary file not shown.
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,6 @@ | ||
dependencies: | ||
- name: karma | ||
repository: https://kubernetes-charts.storage.googleapis.com | ||
version: 1.4.0 | ||
digest: sha256:a3e9e221bcbbb974236a2ad0aa8cad014fd31f7984180b843cdeb79a49b6d75c | ||
generated: "2019-12-17T14:30:00.125669-08:00" |
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,4 @@ | ||
dependencies: | ||
- name: karma | ||
version: "1.4.0" | ||
repository: "https://kubernetes-charts.storage.googleapis.com" |
52 changes: 52 additions & 0 deletions
52
stable/kommander/charts/kommander-karma/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,52 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kommander-karma.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 "kommander-karma.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 "kommander-karma.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a truncated name suitable for resources that need shorter names, such as addons. | ||
*/}} | ||
{{- define "kommander-karma.short-name-prefix" -}} | ||
{{- include "kommander-karma.fullname" . | trunc 36 -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "kommander-karma.labels" -}} | ||
app.kubernetes.io/name: {{ include "kommander-karma.name" . }} | ||
helm.sh/chart: {{ include "kommander-karma.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} |
27 changes: 27 additions & 0 deletions
27
stable/kommander/charts/kommander-karma/templates/cleanup-configmap.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,27 @@ | ||
{{- if .Values.karma.configMap.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: karma-configmap-cleanup | ||
labels: | ||
{{ include "kommander-karma.labels" . | indent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-weight": "5" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
metadata: | ||
name: karma-configmap-cleanup | ||
spec: | ||
serviceAccountName: {{ .Values.kommanderServiceAccount }} | ||
containers: | ||
- name: kubectl | ||
image: bitnami/kubectl:1.16.2 | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
- kubectl delete configmap {{ .Values.kommanderKarmaConfigMap }} | ||
restartPolicy: OnFailure | ||
{{- end }} |
37 changes: 37 additions & 0 deletions
37
stable/kommander/charts/kommander-karma/templates/federated-addon.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,37 @@ | ||
{{- if .Values.federate.addons }} | ||
--- | ||
apiVersion: types.kubefed.io/v1beta1 | ||
kind: FederatedAddon | ||
metadata: | ||
name: {{ include "kommander-karma.short-name-prefix" . }}-proxy | ||
namespace: {{ .Values.federate.systemNamespace.name }} | ||
labels: | ||
{{ include "kommander-karma.labels" . | indent 4 }} | ||
spec: | ||
placement: | ||
clusterSelector: | ||
matchLabels: {} | ||
template: | ||
metadata: | ||
namespace: kubeaddons | ||
labels: | ||
kubeaddons.mesosphere.io/name: {{ include "kommander-karma.short-name-prefix" . }}-proxy | ||
spec: | ||
namespace: {{ .Values.federate.systemNamespace.name }} | ||
chartReference: | ||
chart: mtls-proxy | ||
repo: https://mesosphere.github.io/charts/stable | ||
version: 0.1.1 | ||
values: | | ||
--- | ||
target: {{ required "alertmanager address must be set" .Values.alertmanagerAddress }} | ||
certSecretName: {{ template "kommander-karma.fullname" . }}-server-tls | ||
ingress: | ||
enabled: false | ||
service: | ||
type: LoadBalancer | ||
port: 443 | ||
deployment: | ||
annotations: | ||
secret.reloader.stakater.com/reload: {{ template "kommander-karma.fullname" . }}-server-tls | ||
{{- end }} |
33 changes: 33 additions & 0 deletions
33
stable/kommander/charts/kommander-karma/templates/secret.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,33 @@ | ||
{{ $karmaCa := genCA "Kommander Karma CA" 3650 }} | ||
{{ $karmaServer := genSignedCert "server.karma.localhost.localdomain" nil nil 3650 $karmaCa }} | ||
{{ $karmaClient := genSignedCert "client.karma.localhost.localdomain" nil nil 3650 $karmaCa }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: kommander-karma-client-tls | ||
labels: | ||
{{ include "kommander-karma.labels" . | indent 4 }} | ||
data: | ||
tls.crt: {{ b64enc $karmaClient.Cert }} | ||
tls.key: {{ b64enc $karmaClient.Key }} | ||
ca.crt: {{ b64enc $karmaCa.Cert }} | ||
--- | ||
apiVersion: types.kubefed.io/v1beta1 | ||
kind: FederatedSecret | ||
metadata: | ||
name: {{ template "kommander-karma.fullname" . }}-server-tls | ||
namespace: {{ .Values.federate.systemNamespace.name }} | ||
labels: | ||
{{ include "kommander-karma.labels" . | indent 4 }} | ||
spec: | ||
placement: | ||
clusterSelector: | ||
matchLabels: {} | ||
template: | ||
type: Opaque | ||
data: | ||
tls.crt: {{ b64enc $karmaServer.Cert }} | ||
tls.key: {{ b64enc $karmaServer.Key }} | ||
ca.crt: {{ b64enc $karmaCa.Cert }} |
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,85 @@ | ||
# Default values for kommander-karma. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
# Internal address for the cluster's alertmanager. | ||
# alertmanagerAddress: "HOST:PORT" | ||
alertmanagerAddress: "" | ||
# Kommander service account used to delete the karma configmap | ||
kommanderServiceAccount: kommander-kubeaddons | ||
# Name of the karma configmap | ||
kommanderKarmaConfigMap: kommander-kubeaddons-config | ||
|
||
federate: | ||
addons: true | ||
systemNamespace: | ||
name: kommander-system | ||
|
||
karma: | ||
service: | ||
labels: | ||
servicemonitor.kubeaddons.mesosphere.io/path: "kommander__monitoring__karma__metrics" | ||
|
||
ingress: | ||
enabled: true | ||
annotations: | ||
kubernetes.io/ingress.class: "traefik" | ||
traefik.ingress.kubernetes.io/auth-response-headers: "X-Forwarded-User" | ||
traefik.ingress.kubernetes.io/auth-type: "forward" | ||
traefik.ingress.kubernetes.io/auth-url: "http://traefik-forward-auth-kubeaddons.kubeaddons.svc.cluster.local:4181/" | ||
traefik.ingress.kubernetes.io/priority: "4" | ||
path: "/ops/portal/kommander/monitoring/karma" | ||
hosts: | ||
- "" | ||
|
||
livenessProbe: | ||
delay: 5 | ||
period: 5 | ||
path: /ops/portal/kommander/monitoring/karma/ | ||
|
||
configMap: | ||
enabled: true | ||
annotations: | ||
helm.sh/hook: pre-install | ||
helm.sh/hook-delete-policy: before-hook-creation | ||
rawConfig: | ||
alertmanager: | ||
interval: 30s | ||
servers: | ||
# Karma won't start without at least one configured alertmanager. We include a placeholder so that Karma will | ||
# successfully start. The placeholder URI's hostname should not resolve. This placeholder will be removed | ||
# once the corresponding controller discovers a managed cluster and updates this configuration with its | ||
# alertmanager. | ||
- name: placeholder | ||
uri: https://placeholder.invalid | ||
annotations: | ||
default: | ||
hidden: false | ||
hidden: | ||
- help | ||
visible: [] | ||
filters: | ||
default: [] | ||
labels: | ||
color: | ||
static: | ||
- job | ||
unique: | ||
- cluster | ||
- instance | ||
- "@receiver" | ||
keep: [] | ||
strip: [] | ||
listen: | ||
address: "0.0.0.0" | ||
port: 8080 | ||
prefix: /ops/portal/kommander/monitoring/karma/ | ||
log: | ||
config: true | ||
level: info | ||
|
||
certSecretNames: | ||
- kommander-karma-client-tls | ||
|
||
portalRBAC: | ||
enabled: true |
Binary file not shown.
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,22 @@ | ||
# 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 | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
Oops, something went wrong.