-
Notifications
You must be signed in to change notification settings - Fork 1
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
13 changed files
with
236 additions
and
41 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,47 @@ | ||
#!/bin/bash | ||
|
||
# Applies a string of customizations | ||
# | ||
# Invoke with environment variable K set to list of kustomizers to apply in order. | ||
# Usually invoked as a post renderer to helm, i.e.: | ||
# | ||
# K="deployment-keel-tag ingress-ssl-redirect" \ | ||
# helm template platform-api --post-renderer './kustomizers/apply.sh' | ||
# | ||
|
||
kbase=`dirname $0` | ||
|
||
# work on temporary folder | ||
_tmp=$(mktemp -d 2>/dev/null || mktemp -d -t 'krender') | ||
if [[ ! "$_tmp" || ! -d "$_tmp" ]]; then | ||
echo "Could not create temp dir" | ||
exit 1 | ||
fi | ||
|
||
function _cleanup { | ||
rm -fr "$_tmp" | ||
} | ||
|
||
trap _cleanup EXIT | ||
|
||
## Prepare kustomization sequence | ||
# base level: helm output | ||
mkdir "$_tmp/base" | ||
echo "resources: [ helm.yaml ]" > "$_tmp/base/kustomization.yaml" | ||
cat <&0 > "$_tmp/base/helm.yaml" | ||
_base="../base" | ||
|
||
# additional folders per customization | ||
_i=1 | ||
for k in $K; do | ||
_current=`printf %03d $_i` | ||
echo "current: $_current" >&2 | ||
mkdir -p "$_tmp/$_current" | ||
cp -a $kbase/$k/ "$_tmp/$_current" | ||
echo -e "\nbases: [ $_base ]\n" >> "$_tmp/$_current/kustomization.yaml" | ||
# | ||
_base=../$_current | ||
_i=$(($_i + 1)) | ||
done | ||
|
||
kustomize build $_tmp/`basename $_base` |
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,22 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
patches: | ||
- target: | ||
kind: Deployment | ||
name: (api)|(worker)|(client) | ||
## JSON pointer spec: "~1" translates to "/" character in a dictionary key | ||
patch: |- | ||
[ | ||
{"op": "add", | ||
"path": "/metadata/annotations/keel.sh~1policy", | ||
"value": "force"}, | ||
{"op": "add", | ||
"path": "/metadata/annotations/keel.sh~1match-tag", | ||
"value": "true"}, | ||
{"op": "add", | ||
"path": "/metadata/annotations/keel.sh~1trigger", | ||
"value": "poll"}, | ||
{"op": "add", | ||
"path": "/metadata/annotations/keel.sh~1pollSchedule", | ||
"value": "@every 2m"} | ||
] |
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,15 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
patches: | ||
- target: | ||
kind: Ingress | ||
## JSON pointer spec: "~1" translates to "/" character in a dictionary key | ||
patch: |- | ||
[ | ||
{"op": "add", | ||
"path": "/metadata/annotations/ingress.kubernetes.io~1ssl-redirect", | ||
"value": "true"}, | ||
{"op": "add", | ||
"path": "/metadata/annotations/ingress.kubernetes.io~1ssl-proxy-headers", | ||
"value": "X-Forwarded-Proto: https"} | ||
] |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
apiVersion: v1 | ||
name: ushahidi-platform-api | ||
version: 0.0.1-alpha.1 | ||
version: 0.0.1-alpha.2 | ||
icon: https://github.ushahidi.org/helm-charts/icon.png |
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.