Skip to content

Commit

Permalink
[raw]: Publish Chart (#41)
Browse files Browse the repository at this point in the history
Publish raw chart
  • Loading branch information
oliverbaehler authored Mar 15, 2021
1 parent eb2f820 commit e883af0
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 0 deletions.
27 changes: 27 additions & 0 deletions charts/raw/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

# Custom
README.md.gotmpl
examples/
26 changes: 26 additions & 0 deletions charts/raw/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v2
name: raw
description: "Render raw kubernetes manifests managed by a helm release"
type: application
version: 1.0.0
appVersion: 1.0.0
icon: "https://www.bedag.ch/wGlobal/wGlobal/layout/images/logo.svg"
home: "https://github.com/bedag/helm-charts/tree/master/charts/raw"
keywords:
- raw
- templates
- resources
maintainers:
- name: SRE
email: [email protected]
dependencies:
- name: "library"
version: "~0.3.0"
repository: "https://buttahtoast.github.io/helm-charts/"
sources:
- https://github.com/bedag/helm-charts/tree/master/charts/raw
annotations:
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/changes: |
- "[Added]: Chart Initialization"
artifacthub.io/prerelease: "false"
68 changes: 68 additions & 0 deletions charts/raw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Raw

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Render raw kubernetes manifests managed by a helm release

This chart is a port to Helm v3 of the original [raw chart](https://github.com/helm/charts/tree/master/incubator/raw). The chart works for the most parts the same (keep it as simple as possible). So all credits to the original authors. Don't forget to check the library functions, these can be used as well within your templates.
It is under active development and may contain bugs/unfinished documentation. Any testing/contributions are welcome! :)

**Homepage:** <https://github.com/bedag/helm-charts/tree/master/charts/raw>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| SRE | [email protected] | |

## Source Code

* <https://github.com/bedag/helm-charts/tree/master/charts/raw>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://buttahtoast.github.io/helm-charts/ | library | ~0.3.0 |

# Examples

See the following examples to see the full potential:

```
global:
imageRegistry: "company-registry/"
# Consider this Image tag Mainly. But considers global imageRegistry, if set by parent chart.
image:
registry: docker.io
repository: bitnami/apache
templates:
- |
apiVersion: v1
kind: Pod
metadata:
name: static-web
labels:
role: myrole
spec:
containers:
- name: web
image: \{\{ include "lib.utils.globals.image" (dict "image" .Values.image "context" $ ) }}
ports:
- name: web
containerPort: 80
protocol: TCP
```

A very basic example. But might get you started.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| commonLabels | object | `{}` | Common Labels are added to each kubernetes resource manifest. |
| overwriteLabels | object | `{}` | Overwrites default labels, but not resource specific labels and common labels |
| resources | list | `[]` | Define resources to be deployed by the raw chart |
| templates | list | `[]` | Define templates which will be executed using the `tpl` function |
65 changes: 65 additions & 0 deletions charts/raw/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Raw
{{ template "chart.deprecationWarning" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}

{{ template "chart.description" . }}

This chart is a port to Helm v3 of the original [raw chart](https://github.com/helm/charts/tree/master/incubator/raw). The chart works for the most parts the same (keep it as simple as possible). So all credits to the original authors. Don't forget to check the library functions, these can be used as well within your templates.
It is under active development and may contain bugs/unfinished documentation. Any testing/contributions are welcome! :)

{{ template "chart.homepageLine" . }}

{{/*
Chart Maintainers
*/}}
{{ template "chart.maintainersSection" . }}

{{/*
Chart Sources
*/}}
{{ template "chart.sourcesSection" . }}

{{/*
Chart Requirements
*/}}
{{ template "chart.requirementsSection" . }}

# Examples

See the following examples to see the full potential:

```
global:
imageRegistry: "company-registry/"

# Consider this Image tag Mainly. But considers global imageRegistry, if set by parent chart.
image:
registry: docker.io
repository: bitnami/apache

templates:
- |
apiVersion: v1
kind: Pod
metadata:
name: static-web
labels:
role: myrole
spec:
containers:
- name: web
image: \{\{ include "lib.utils.globals.image" (dict "image" .Values.image "context" $ ) }}
ports:
- name: web
containerPort: 80
protocol: TCP
```

A very basic example. But might get you started.


{{/*
Chart Values
*/}}
{{ template "chart.valuesSection" . }}
26 changes: 26 additions & 0 deletions charts/raw/templates/_rendering.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{/*
Copyright © 2021 Bedag Informatik AG
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
raw.resource will create a resource template that can be
merged with each item in `.Values.resources`.
*/}}
{{- define "raw.labels" -}}
metadata:
labels: {{- include "lib.utils.common.commonLabels" $ | nindent 4 }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/raw/templates/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{/*

Copyright © 2021 Bedag Informatik AG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/}}
{{- if or $.Values.resources $.Values.templates -}}
{{- $base := fromYaml (include "raw.labels" .) -}}
{{- range $.Values.resources }}
---{{- toYaml (merge . $base) | nindent 0 }}
{{- end }}
{{- range $.Values.templates }}
---{{- toYaml (merge (tpl . $ | fromYaml) $base) | nindent 0 }}
{{- end }}
{{- end -}}

33 changes: 33 additions & 0 deletions charts/raw/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Common Labels
# commonLabels -- Common Labels are added to each kubernetes resource manifest.
commonLabels: {}

## Overwrite Labels
# overwriteLabels -- Overwrites default labels, but not resource specific labels and common labels
overwriteLabels: {}

## Define Pure kubernetes resources
# resources -- Define resources to be deployed by the raw chart
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."
#

# templates -- Define templates which will be executed using the `tpl` function
templates: []


0 comments on commit e883af0

Please sign in to comment.