Skip to content

Commit

Permalink
chore(helm): make all namespaces variable
Browse files Browse the repository at this point in the history
Update generate-deploy-yamls.sh to take a namespace argument. This
defaults to mayastor and is used when generating the YAML files using
Helm.
  • Loading branch information
Paul Yoong committed Feb 1, 2022
1 parent 3d4416a commit b0eadaf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/templates/etcd/storage/localpv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
namespace: mayastor
namespace: {{ $.Release.Namespace }}
name: etcd-volume-{{ $index }}
labels:
statefulset.kubernetes.io/pod-name: mayastor-etcd-{{ $index }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/mayastor-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
app: mayastor
spec:
hostNetwork: true
# To resolve services from mayastor's namespace
# To resolve services in the namespace
dnsPolicy: ClusterFirstWithHostNet
nodeSelector:
openebs.io/engine: mayastor
Expand Down
8 changes: 7 additions & 1 deletion scripts/generate-deploy-yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ registry=
tag=
helm_string=
helm_file=
namespace="mayastor"

help() {
cat <<EOF
Expand All @@ -36,6 +37,7 @@ Common options:
-t <tag> Tag of mayastor images overriding the profile's default.
-s <variables> Set chart values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
-f <file> Specify values in a YAML file or a URL (can specify multiple)
-n <namespace> Namespace of the generated YAML files
Profiles:
develop: Used by developers of mayastor.
Expand Down Expand Up @@ -79,6 +81,10 @@ while [ "$#" -gt 0 ]; do
shift
tag=$1
;;
-n)
shift
namespace=$1
;;
-*)
echo "Unknown option: $1"
help
Expand Down Expand Up @@ -176,7 +182,7 @@ fi
# update helm dependencies
( cd "$SCRIPTDIR"/../chart && helm dependency update )
# generate the yaml
helm template --set "$template_params" mayastor "$SCRIPTDIR/../chart" --output-dir="$tmpd" --namespace mayastor -f "$SCRIPTDIR/../chart/$profile/values.yaml" --set "$helm_string" -f "$helm_file"
helm template --set "$template_params" mayastor "$SCRIPTDIR/../chart" --output-dir="$tmpd" --namespace $namespace -f "$SCRIPTDIR/../chart/$profile/values.yaml" --set "$helm_string" -f "$helm_file"

# our own autogenerated yaml files
mv -f "$tmpd"/mayastor/templates/* "$output_dir/"
Expand Down

0 comments on commit b0eadaf

Please sign in to comment.