Skip to content

Commit

Permalink
Feat/default resources (#4)
Browse files Browse the repository at this point in the history
* feat(default-resources): upload default-resources chart

* fix(default-resources): delete wrong files
  • Loading branch information
amartingarcia authored Nov 4, 2022
1 parent 6a827ec commit 0768d9f
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 0 deletions.
22 changes: 22 additions & 0 deletions charts/default-resources/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Chart info
apiVersion: v2
name: default-resources
description: A Helm chart for Default Resources

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.0.0
23 changes: 23 additions & 0 deletions charts/default-resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# default-resources

![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) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)

A Helm chart for Default Resources

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| VolumeSnapshotClass.config | list | `[]` | |
| VolumeSnapshotClass.create | bool | `false` | |
| namespaces.create | bool | `false` | |
| namespaces.name | list | `[]` | |
| quotas.config | list | `[]` | |
| quotas.create | bool | `false` | |
| secrets.config | list | `[]` | |
| secrets.create | bool | `false` | |
| serviceAccounts.config | list | `[]` | |
| serviceAccounts.create | bool | `false` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Empty file.
27 changes: 27 additions & 0 deletions charts/default-resources/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "default-resources.name" -}}
{{- default .Chart.Name -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "default-resources.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "default-resources.labels" -}}
app.kubernetes.io/name: {{ include "default-resources.name" . }}
helm.sh/chart: {{ include "default-resources.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 -}}
10 changes: 10 additions & 0 deletions charts/default-resources/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ if .Values.namespaces.create }}
{{ range .Values.namespaces.name }}
---
apiVersion: v1
kind: Namespace
metadata:
name: {{ . }}

{{ end }}
{{ end }}
14 changes: 14 additions & 0 deletions charts/default-resources/templates/quota.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ if (.Values.quotas.create)}}
{{ range .Values.quotas.config }}
---
apiVersion: v1
kind: ResourceQuota
metadata:
name: {{ .namespace }}
namespace: {{ .namespace }}
spec:
hard:
{{ toYaml .spec | indent 4 }}

{{ end }}
{{ end }}
16 changes: 16 additions & 0 deletions charts/default-resources/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ if .Values.secrets.create }}
{{ range $secrets := .Values.secrets.config }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ .namespace }}
type: {{ .type }}
data:
{{- range $key, $value := $secrets.data }}
{{ $value.name }}: {{ $value.value | b64enc | quote }}
{{- end }}

{{ end }}
{{ end }}
15 changes: 15 additions & 0 deletions charts/default-resources/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ if .Values.serviceAccounts.create }}
{{ range .Values.serviceAccounts.config }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .name }}
annotations:
{{- with .annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .namespace }}

{{ end }}
{{ end }}
20 changes: 20 additions & 0 deletions charts/default-resources/templates/volumesnapshotclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ if .Values.VolumeSnapshotClass.create }}
{{ range .Values.VolumeSnapshotClass.config }}
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: {{ .name }}
labels:
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
driver: {{ .driver }}
deletionPolicy: {{ .deletionPolicy }}
parameters:
{{- with .parameters }}
{{- toYaml . | nindent 2 }}
{{- end }}

{{ end }}
{{ end }}
63 changes: 63 additions & 0 deletions charts/default-resources/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Custom values for default-resources.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
namespaces:
create: false
name: []
# - integration
# - monitoring

quotas:
create: false
config: []
# - namespace: integration
# quota_requests_cpu: "4"
# quota_requests_memory: "6Gi"
# quota_limits_cpu: "4"
# quota_limits_memory: "6Gi"
# - namespace: monitoring
# quota_requests_cpu: "2"
# quota_requests_memory: "2Gi"
# quota_limits_cpu: "2"
# quota_limits_memory: "2Gi"

secrets:
create: false
config: []
# - name: my-secret
# namespace: my-namespace
# type: Opaque
# data:
# - name: data-name
# value: data-value

serviceAccounts:
create: false
config: []
# - name: integration
# namespace: integration
# clusterRoleRules: []
# - apiGroups: ["extensions", "app"]
# resources: ["deployments"]
# verbs: ["get", "list", "watch", "create", "update", "patch"]
# - apiGroups: ["extensions", "app"]
# resources: ["deployments"]
# verbs: ["get", "list", "watch", "create", "update", "patch"]
# - name: monitoring
# namespace: monitoring
# clusterRoleRules: []
# - apiGroups: ["*"]
# resources: ["*"]
# verbs: ["get", "list"]

VolumeSnapshotClass:
create: false
config: []
# - name: my-volume-snapshot-class
# labels:
# key: value
# driver: my-driver
# deletionPolicy: Retain
# parameters:
# tags: 'foo=aaa,bar=bbb'

0 comments on commit 0768d9f

Please sign in to comment.