-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
39 changed files
with
938 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 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 |
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 @@ | ||
apiVersion: v2 | ||
appVersion: 0.2.3 | ||
name: raw | ||
home: https://github.com/helm/charts/blob/master/incubator/raw | ||
description: A place for all the Kubernetes resources which don't already have a home. | ||
version: 0.3.0 |
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 @@ | ||
approvers: | ||
- josdotso | ||
- mumoshu | ||
reviewers: | ||
- josdotso | ||
- mumoshu |
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,129 @@ | ||
# incubator/raw | ||
|
||
The `incubator/raw` chart takes a list of Kubernetes resources and | ||
merges each resource with a default `metadata.labels` map and installs | ||
the result. | ||
|
||
The Kubernetes resources can be "raw" ones defined under the `resources` key, or "templated" ones defined under the `templates` key. | ||
|
||
Some use cases for this chart include Helm-based installation and | ||
maintenance of resources of kinds: | ||
- LimitRange | ||
- PriorityClass | ||
- Secret | ||
|
||
## Usage | ||
|
||
### Raw resources | ||
|
||
#### STEP 1: Create a yaml file containing your raw resources. | ||
|
||
``` | ||
# raw-priority-classes.yaml | ||
resources: | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: common-critical | ||
value: 100000000 | ||
globalDefault: false | ||
description: "This priority class should only be used for critical priority common pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: common-high | ||
value: 90000000 | ||
globalDefault: false | ||
description: "This priority class should only be used for high priority common pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: common-medium | ||
value: 80000000 | ||
globalDefault: false | ||
description: "This priority class should only be used for medium priority common pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: common-low | ||
value: 70000000 | ||
globalDefault: false | ||
description: "This priority class should only be used for low priority common pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: app-critical | ||
value: 100000 | ||
globalDefault: false | ||
description: "This priority class should only be used for critical priority app pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: app-high | ||
value: 90000 | ||
globalDefault: false | ||
description: "This priority class should only be used for high priority app pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: app-medium | ||
value: 80000 | ||
globalDefault: true | ||
description: "This priority class should only be used for medium priority app pods." | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: app-low | ||
value: 70000 | ||
globalDefault: false | ||
description: "This priority class should only be used for low priority app pods." | ||
``` | ||
|
||
#### STEP 2: Install your raw resources. | ||
|
||
``` | ||
helm install --name raw-priority-classes incubator/raw -f raw-priority-classes.yaml | ||
``` | ||
|
||
### Templated resources | ||
|
||
#### STEP 1: Create a yaml file containing your templated resources. | ||
|
||
``` | ||
# values.yaml | ||
templates: | ||
- | | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: common-secret | ||
stringData: | ||
mykey: {{ .Values.mysecret }} | ||
``` | ||
|
||
The yaml file containing `mysecret` should be encrypted with a tool like [helm-secrets](https://github.com/futuresimple/helm-secrets) | ||
|
||
``` | ||
# secrets.yaml | ||
mysecret: abc123 | ||
``` | ||
|
||
``` | ||
$ helm secrets enc secrets.yaml | ||
``` | ||
|
||
#### STEP 2: Install your templated resources. | ||
|
||
``` | ||
helm secrets install --name mysecret incubator/raw -f values.yaml -f secrets.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,8 @@ | ||
resources: | ||
- apiVersion: scheduling.k8s.io/v1beta1 | ||
kind: PriorityClass | ||
metadata: | ||
name: common-critical | ||
value: 100000000 | ||
globalDefault: false | ||
description: "This priority class should only be used for critical priority common pods." |
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 @@ | ||
templates: | ||
- | | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: raw |
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,18 @@ | ||
resources: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: common | ||
stringData: | ||
foo: bar | ||
|
||
mysecret: abc134 | ||
|
||
templates: | ||
- | | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: common-secret | ||
stringData: | ||
mykey: "{{ .Values.mysecret }}" |
Empty file.
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,45 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "raw.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 "raw.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 "raw.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
raw.resource will create a resource template that can be | ||
merged with each item in `.Values.resources`. | ||
*/}} | ||
{{- define "raw.resource" -}} | ||
metadata: | ||
labels: | ||
app: {{ template "raw.name" . }} | ||
chart: {{ template "raw.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- end }} |
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 @@ | ||
{{- $template := fromYaml (include "raw.resource" .) -}} | ||
{{- range .Values.resources }} | ||
--- | ||
{{ toYaml (merge . $template) -}} | ||
{{- end }} | ||
{{- range $i, $t := .Values.templates }} | ||
--- | ||
{{ toYaml (merge (tpl $t $ | fromYaml) $template) -}} | ||
{{- end }} |
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,80 @@ | ||
resources: [] | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: common-critical | ||
# value: 100000000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for critical priority common pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: common-high | ||
# value: 90000000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for high priority common pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: common-medium | ||
# value: 80000000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for medium priority common pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: common-low | ||
# value: 70000000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for low priority common pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: app-critical | ||
# value: 100000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for critical priority app pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: app-high | ||
# value: 90000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for high priority app pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: app-medium | ||
# value: 80000 | ||
# globalDefault: true | ||
# description: "This priority class should only be used for medium priority app pods." | ||
# | ||
# - apiVersion: scheduling.k8s.io/v1beta1 | ||
# kind: PriorityClass | ||
# metadata: | ||
# name: app-low | ||
# value: 70000 | ||
# globalDefault: false | ||
# description: "This priority class should only be used for low priority app pods." | ||
|
||
templates: [] | ||
# - | | ||
# apiVersion: v1 | ||
# kind: ConfigMap | ||
# metadata: | ||
# name: raw | ||
# | ||
# - | | ||
# apiVersion: v1 | ||
# kind: Secret | ||
# metadata: | ||
# name: common-secret | ||
# stringData: | ||
# mykey: {{ .Values.mysecret }} |
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,11 @@ | ||
--- | ||
bases: | ||
- bases/helmDefaults.yaml | ||
- bases/environments.yaml | ||
|
||
helmfiles: | ||
- path: releases/loki/helmfile.yaml | ||
values: | ||
- {{ toYaml .Values | nindent 4 }} | ||
|
||
missingFileHandler: Warn |
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,11 @@ | ||
--- | ||
bases: | ||
- bases/helmDefaults.yaml | ||
- bases/environments.yaml | ||
|
||
helmfiles: | ||
- path: releases/prometheus-stack/helmfile.yaml | ||
values: | ||
- {{ toYaml .Values | nindent 4 }} | ||
|
||
missingFileHandler: Warn |
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,11 @@ | ||
--- | ||
bases: | ||
- bases/helmDefaults.yaml | ||
- bases/environments.yaml | ||
|
||
helmfiles: | ||
- path: releases/promtail/helmfile.yaml | ||
values: | ||
- {{ toYaml .Values | nindent 4 }} | ||
|
||
missingFileHandler: Warn |
Oops, something went wrong.