Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(kommander): Use thanos & karma source code as subcharts #453

Merged
merged 17 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/kommander/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: alejandroEsc
- name: jimmidyson
name: kommander
version: 0.5.2
version: 0.5.3
Binary file removed stable/kommander/charts/kommander-karma-0.3.8.tgz
Binary file not shown.
22 changes: 22 additions & 0 deletions stable/kommander/charts/kommander-karma/.helmignore
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/
9 changes: 9 additions & 0 deletions stable/kommander/charts/kommander-karma/Chart.yaml
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
84 changes: 84 additions & 0 deletions stable/kommander/charts/kommander-karma/README.md
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.
6 changes: 6 additions & 0 deletions stable/kommander/charts/kommander-karma/requirements.lock
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"
4 changes: 4 additions & 0 deletions stable/kommander/charts/kommander-karma/requirements.yaml
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 stable/kommander/charts/kommander-karma/templates/_helpers.tpl
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 -}}
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 }}
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 stable/kommander/charts/kommander-karma/templates/secret.yaml
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 }}
85 changes: 85 additions & 0 deletions stable/kommander/charts/kommander-karma/values.yaml
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.
22 changes: 22 additions & 0 deletions stable/kommander/charts/kommander-thanos/.helmignore
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/
Loading