mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[incubator/raw] New chart (#6992)
* [incubator/raw] New chart * [incubator/raw] Fixup: remove trailing spaces in values.yaml * [incubator/raw] Fixup: Add home to Chart.yaml
This commit is contained in:
committed by
k8s-ci-robot
parent
ec2ff36c76
commit
09758ec3db
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
name: raw
|
||||
home: https://github.com/helm/charts/blob/master/incubator/raw
|
||||
version: 0.1.0
|
||||
appVersion: 0.1.0
|
||||
description: A place for all the Kubernetes resources which don't already have a home.
|
||||
maintainers:
|
||||
- name: josdotso
|
||||
email: josdotso@cisco.com
|
||||
@@ -0,0 +1,4 @@
|
||||
approvers:
|
||||
- josdotso
|
||||
reviewers:
|
||||
- josdotso
|
||||
@@ -0,0 +1,90 @@
|
||||
# incubator/raw
|
||||
|
||||
The `incubator/raw` chart takes a list of raw Kubernetes resources and
|
||||
merges each resource with a default `metadata.labels` map and installs
|
||||
the result.
|
||||
|
||||
Some use cases for this chart include Helm-based installation and
|
||||
maintenance of resources of kinds:
|
||||
- LimitRange
|
||||
- PriorityClass
|
||||
|
||||
## Usage
|
||||
|
||||
### 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
|
||||
```
|
||||
@@ -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 }}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{- $template := fromYaml (include "raw.resource" .) -}}
|
||||
{{- range .Values.resources }}
|
||||
---
|
||||
{{- toYaml (merge . $template) -}}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,65 @@
|
||||
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."
|
||||
Reference in New Issue
Block a user