@leverege/build-tools 1.10.0 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/server/helmup CHANGED
@@ -24,7 +24,6 @@ SYSTEM=(
24
24
  descheduler
25
25
  disks
26
26
  elastic
27
- keel
28
27
  monitoring
29
28
  polaris
30
29
  redis
@@ -80,6 +79,31 @@ KEELNEEDS
80
79
  exit 1
81
80
  }
82
81
 
82
+ function createSSDYAML(){
83
+ cat<<EOSSD > k8-utils/ssd-storageclass.yaml
84
+ apiVersion: storage.k8s.io/v1
85
+ kind: StorageClass
86
+ metadata:
87
+ name: ssd
88
+ provisioner: kubernetes.io/gce-pd
89
+ parameters:
90
+ type: pd-ssd
91
+ EOSSD
92
+ }
93
+
94
+ function checkSSDStorageClass(){
95
+ kubectl get storageclass ssd
96
+ if [[ $? -eq 1 ]]; then
97
+ printf "\n*** SSD Storage Class not defined ***\n\n"
98
+ if [ ! -f k8-utils/ssd-storageclass.yaml ]; then
99
+ createSSDYAML
100
+ fi
101
+ kubectl apply -f k8-utils/ssd-storageclass.yaml
102
+ fi
103
+
104
+ printf "\n*** Attaching PVC to SSD Class ***\n\n"
105
+ }
106
+
83
107
  function installKeel() {
84
108
  [ ! -d "$LEV_KEYS" ] &&
85
109
  keelNeeds "`color c \\$LEV_KEYS` must point to the keys directory for the clusters."
@@ -90,6 +114,8 @@ function installKeel() {
90
114
  keelNeeds "Missing service account info => `color c $SVC_ACCT`"
91
115
 
92
116
  BRANCH=`git rev-parse --abbrev-ref HEAD`
117
+ SLACK_BOT_NAME="`overwhelm -k SLACK_BOT_NAME`"
118
+ [ -z "$SLACK_BOT_NAME" ] && SLACK_BOT_NAME=$BRANCH
93
119
  SLACK_TOKEN="$LEV_KEYS/$BRANCH/slack-bot-token"
94
120
  [ ! -f "$SLACK_TOKEN" ] &&
95
121
  keelNeeds "Missing slack bot token => `color c $SLACK_TOKEN`"
@@ -102,7 +128,7 @@ function installKeel() {
102
128
  --set slack.enabled="true" \
103
129
  --set slack.channel="devs-cicd" \
104
130
  --set slack.approvalsChannel="cd-approvals" \
105
- --set slack.botName="$BRANCH" \
131
+ --set slack.botName="$SLACK_BOT_NAME" \
106
132
  --set slack.token="$(cat $SLACK_TOKEN)" \
107
133
  --set googleApplicationCredentials="$(cat $SVC_ACCT | base64 -w 0)"
108
134
  }
@@ -138,6 +164,7 @@ function doInstall() {
138
164
  case "$SERVICE" in
139
165
  "platform")
140
166
  doInstall "${PLATFORM[@]}"
167
+ printf "\nkeel may be installed by running => helmup keel\n\n"
141
168
  ;;
142
169
 
143
170
  "system")
@@ -146,16 +173,18 @@ function doInstall() {
146
173
 
147
174
  "descheduler")
148
175
  helm repo add akomljen-charts https://raw.githubusercontent.com/komljen/helm-charts/master/charts/
149
- helm upgrade --install descheduler akomljen-charts/descheduler --set schedule="*/13 * * * *"
176
+ helm upgrade --install descheduler akomljen-charts/descheduler --set schedule="*/15 * * * *",deschedulerPolicy.strategies.RemovePodsViolatingNodeAffinity.params.nodeAffinityType={preferredDuringSchedulingIgnoredDuringExecution}
150
177
  ;;
151
178
 
152
179
  "disks")
180
+ checkSSDStorageClass
153
181
  helm upgrade --install disks ./disks
154
182
  ;;
155
183
 
156
184
  "elastic"|"elasticsearch")
185
+ checkSSDStorageClass
157
186
  helm repo add elastic https://helm.elastic.co
158
- helm upgrade --install elasticsearch elastic/elasticsearch --version 7.2.0
187
+ helm upgrade --install elasticsearch elastic/elasticsearch --set volumeClaimTemplate.storageClassName="ssd"
159
188
  ;;
160
189
 
161
190
  "keel")
@@ -169,7 +198,7 @@ function doInstall() {
169
198
  "polaris")
170
199
  helm repo add reactiveops-stable https://charts.reactiveops.com/stable
171
200
  helm upgrade --install polaris reactiveops-stable/polaris --namespace polaris
172
- printf "\n***Proxy 8080 with this=> kubectl port-forward --namespace polaris svc/polaris-dashboard 8080:80\n\n"
201
+ printf "\n***Proxy 8081 with this=> kubectl port-forward --namespace polaris svc/polaris-dashboard 8081:80\n\n"
173
202
  ;;
174
203
 
175
204
  "redis")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "A package for development build tools.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/helmup CHANGED
@@ -24,7 +24,6 @@ SYSTEM=(
24
24
  descheduler
25
25
  disks
26
26
  elastic
27
- keel
28
27
  monitoring
29
28
  polaris
30
29
  redis
@@ -80,6 +79,31 @@ KEELNEEDS
80
79
  exit 1
81
80
  }
82
81
 
82
+ function createSSDYAML(){
83
+ cat<<EOSSD > k8-utils/ssd-storageclass.yaml
84
+ apiVersion: storage.k8s.io/v1
85
+ kind: StorageClass
86
+ metadata:
87
+ name: ssd
88
+ provisioner: kubernetes.io/gce-pd
89
+ parameters:
90
+ type: pd-ssd
91
+ EOSSD
92
+ }
93
+
94
+ function checkSSDStorageClass(){
95
+ kubectl get storageclass ssd
96
+ if [[ $? -eq 1 ]]; then
97
+ printf "\n*** SSD Storage Class not defined ***\n\n"
98
+ if [ ! -f k8-utils/ssd-storageclass.yaml ]; then
99
+ createSSDYAML
100
+ fi
101
+ kubectl apply -f k8-utils/ssd-storageclass.yaml
102
+ fi
103
+
104
+ printf "\n*** Attaching PVC to SSD Class ***\n\n"
105
+ }
106
+
83
107
  function installKeel() {
84
108
  [ ! -d "$LEV_KEYS" ] &&
85
109
  keelNeeds "`color c \\$LEV_KEYS` must point to the keys directory for the clusters."
@@ -90,6 +114,8 @@ function installKeel() {
90
114
  keelNeeds "Missing service account info => `color c $SVC_ACCT`"
91
115
 
92
116
  BRANCH=`git rev-parse --abbrev-ref HEAD`
117
+ SLACK_BOT_NAME="`overwhelm -k SLACK_BOT_NAME`"
118
+ [ -z "$SLACK_BOT_NAME" ] && SLACK_BOT_NAME=$BRANCH
93
119
  SLACK_TOKEN="$LEV_KEYS/$BRANCH/slack-bot-token"
94
120
  [ ! -f "$SLACK_TOKEN" ] &&
95
121
  keelNeeds "Missing slack bot token => `color c $SLACK_TOKEN`"
@@ -102,7 +128,7 @@ function installKeel() {
102
128
  --set slack.enabled="true" \
103
129
  --set slack.channel="devs-cicd" \
104
130
  --set slack.approvalsChannel="cd-approvals" \
105
- --set slack.botName="$BRANCH" \
131
+ --set slack.botName="$SLACK_BOT_NAME" \
106
132
  --set slack.token="$(cat $SLACK_TOKEN)" \
107
133
  --set googleApplicationCredentials="$(cat $SVC_ACCT | base64 -w 0)"
108
134
  }
@@ -138,6 +164,7 @@ function doInstall() {
138
164
  case "$SERVICE" in
139
165
  "platform")
140
166
  doInstall "${PLATFORM[@]}"
167
+ printf "\nkeel may be installed by running => helmup keel\n\n"
141
168
  ;;
142
169
 
143
170
  "system")
@@ -146,16 +173,18 @@ function doInstall() {
146
173
 
147
174
  "descheduler")
148
175
  helm repo add akomljen-charts https://raw.githubusercontent.com/komljen/helm-charts/master/charts/
149
- helm upgrade --install descheduler akomljen-charts/descheduler --set schedule="*/13 * * * *"
176
+ helm upgrade --install descheduler akomljen-charts/descheduler --set schedule="*/15 * * * *",deschedulerPolicy.strategies.RemovePodsViolatingNodeAffinity.params.nodeAffinityType={preferredDuringSchedulingIgnoredDuringExecution}
150
177
  ;;
151
178
 
152
179
  "disks")
180
+ checkSSDStorageClass
153
181
  helm upgrade --install disks ./disks
154
182
  ;;
155
183
 
156
184
  "elastic"|"elasticsearch")
185
+ checkSSDStorageClass
157
186
  helm repo add elastic https://helm.elastic.co
158
- helm upgrade --install elasticsearch elastic/elasticsearch --version 7.2.0
187
+ helm upgrade --install elasticsearch elastic/elasticsearch --set volumeClaimTemplate.storageClassName="ssd"
159
188
  ;;
160
189
 
161
190
  "keel")
@@ -169,7 +198,7 @@ function doInstall() {
169
198
  "polaris")
170
199
  helm repo add reactiveops-stable https://charts.reactiveops.com/stable
171
200
  helm upgrade --install polaris reactiveops-stable/polaris --namespace polaris
172
- printf "\n***Proxy 8080 with this=> kubectl port-forward --namespace polaris svc/polaris-dashboard 8080:80\n\n"
201
+ printf "\n***Proxy 8081 with this=> kubectl port-forward --namespace polaris svc/polaris-dashboard 8081:80\n\n"
173
202
  ;;
174
203
 
175
204
  "redis")