-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from buttahtoast/master
Manifests 0.2.0
- Loading branch information
Showing
58 changed files
with
870 additions
and
191 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ | |
|
||
# Custom | ||
README.md.gotmpl | ||
plugin/ |
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 |
---|---|---|
|
@@ -2,19 +2,21 @@ apiVersion: v2 | |
name: manifests | ||
description: "Bedag's Manifest chart. Library full of basic kubernetes manifests." | ||
type: library | ||
version: 0.1.2 | ||
version: 0.2.0 | ||
icon: "https://www.bedag.ch/wGlobal/wGlobal/layout/images/logo.svg" | ||
keywords: | ||
- Bedag | ||
- Manifests | ||
- Library | ||
- Bedag | ||
- Manifests | ||
- Library | ||
maintainers: | ||
- name: oliverbaehler | ||
email: [email protected] | ||
- name: oliverbaehler | ||
email: [email protected] | ||
- name: SRE | ||
email: [email protected] | ||
dependencies: | ||
- name: "library" | ||
version: 0.2.0 | ||
repository: https://buttahtoast.github.io/helm-charts/ | ||
- name: "library" | ||
version: "~0.3.0" | ||
repository: "https://buttahtoast.github.io/helm-charts/" | ||
annotations: | ||
artifacthub.io/containsSecurityUpdates: "false" | ||
artifacthub.io/prerelease: "true" |
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,30 @@ | ||
# Values Generator | ||
|
||
This is currently only a temporary solution. | ||
|
||
# Install | ||
|
||
To install this plugin, clone the entire git repository. | ||
|
||
Make sure the script is executable: | ||
|
||
``` | ||
chmod +x helm-charts/charts/manifests/plugin/generator.sh | ||
``` | ||
|
||
## Local | ||
|
||
You can install Helm Plugins local. This means, in the HELM_PLUGIN directory will be a symbolic link created given to the directory. This is how you would install it locally: | ||
|
||
``` | ||
helm install helm-charts/charts/manifests/plugin | ||
``` | ||
Since it's a symbolic link, the git repository has to persist. | ||
|
||
# Usage | ||
|
||
Learn which arguments are available: | ||
|
||
``` | ||
helm manifests -h | ||
``` |
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,69 @@ | ||
#!/bin/bash | ||
|
||
## -- Help Context | ||
show_help() { | ||
cat << EOF | ||
Usage: ${0##*/} [-h] [-p] ] | ||
-m [manifest] Manifest Name | ||
-p [preset] Preset Name | ||
-k [parentkey] Custom Parent Key | ||
-P [keypath] Custom Key Path | ||
-a [helm args] Additional Helm Arguments | ||
-M Minimal Structure | ||
-h Show this context | ||
EOF | ||
} | ||
|
||
## -- Defaults | ||
MANIFEST="" | ||
PRESET="" | ||
HELM_ARGS="" | ||
KEYPATH="" | ||
MINIMAL="" | ||
PARENTKEY="" | ||
|
||
## -- Opting arguments | ||
OPTIND=1; # Reset OPTIND, to clear getopts when used in a prior script | ||
while getopts ":ha:P:k:m:p:k:M" opt; do | ||
case ${opt} in | ||
m) | ||
MANIFEST="${OPTARG}" | ||
;; | ||
p) | ||
PRESET="${OPTARG}" | ||
;; | ||
k) | ||
PARENTKEY="${OPTARG}" | ||
;; | ||
P) | ||
KEYPATH="${OPTARG}" | ||
;; | ||
a) | ||
HELM_ARGS="${OPTARG}" | ||
;; | ||
M) | ||
MINIMAL="true" | ||
;; | ||
h) | ||
show_help | ||
exit 0 | ||
;; | ||
?) | ||
echo "Invalid Option: -$OPTARG" 1>&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND -1)) | ||
|
||
## -- Helm Values | ||
HELM_VALUES="" | ||
[ -n "$MANIFEST" ] && HELM_VALUES="--set doc.manifest=${MANIFEST}" | ||
[ -n "$PRESET" ] && HELM_VALUES="${HELM_VALUES} --set doc.preset=${PRESET}" | ||
[ -n "$KEYPATH" ] && HELM_VALUES="${HELM_VALUES} --set doc.path=${KEYPATH}" | ||
[ -n "$PARENTKEY" ] && HELM_VALUES="${HELM_VALUES} --set doc.key=${PARENTKEY}" | ||
[ -n "$MINIMAL" ] && HELM_VALUES="${HELM_VALUES} --set doc.minimal=true" | ||
|
||
## -- Execute Helm | ||
$HELM_BIN template $HELM_VALUES ${HELM_ARGS} --dependency-update values-generator/ |
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 @@ | ||
name: "manifests" | ||
version: "0.1.0" | ||
usage: "Get Manifest Values" | ||
description: "Get Manifest Values" | ||
ignoreFlags: false | ||
command: "bash ./generator.sh" |
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,23 @@ | ||
# 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/ |
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,10 @@ | ||
apiVersion: v2 | ||
name: values | ||
description: A Helm chart for Kubernetes | ||
type: application | ||
version: 1.0.0 | ||
appVersion: 1.16.0 | ||
dependencies: | ||
- name: "manifests" | ||
version: ">=0.1.0" | ||
repository: https://bedag.github.io/helm-charts |
1 change: 1 addition & 0 deletions
1
charts/manifests/plugin/values-generator/templates/values-generator.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 @@ | ||
{{- include "bedag-lib.values.generator" $ | nindent 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,26 @@ | ||
## Enabled Values Generator | ||
doc: | ||
|
||
## Define which manifest to generate (e.g. "statfulset") | ||
## On of .manifest or .preset has to be set, otherwise the function returns empty | ||
manifest: "" | ||
|
||
## Define which manifest to generate (e.g. "permissions") | ||
## On of .manifest or .preset has to be set, otherwise the function returns empty | ||
## The .manifest field takes precedence over the .preset field, if both are set. | ||
preset: "" | ||
|
||
## If you want your values to be in a more complex structure, you can define the yaml path | ||
## This mostly matters for all the helm-docs fields being generated. | ||
#path: "custom.sub.path" | ||
path: "" | ||
|
||
## Overwrite the top key for the values. | ||
## E.g. for the manifest statefulset the default top key is "statefulset", which has all other | ||
## keys as child. With this option you can change this key to e.g. "frontend" | ||
key: "" | ||
|
||
## A single manifest can have a lot of values. With enabling minimal output the values | ||
## which come from sub templates or manifests will only be referenced as comment but not printed | ||
## to keep your values slim. | ||
minimal: false |
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
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
Oops, something went wrong.