@leverege/build-tools 2.8.8 → 2.8.9

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.
@@ -284,10 +284,10 @@ ahoy.forEach(dir => {
284
284
  const valuesAll = YAML.load(valuesOut);
285
285
  const valuesSvc = {
286
286
  service: {
287
- PROJECT_ID: 'OVH:<PROJECT_ID>',
288
- PROJECT_NAME: 'OVH:<PROJECT_NAME>',
289
- HOST: 'OVH:<HOST>',
290
- INGRESS: 'OVH:<INGRESS>'
287
+ project_id: 'OVH:<PROJECT_ID>',
288
+ project_name: 'OVH:<PROJECT_NAME>',
289
+ host: 'OVH:<HOST>',
290
+ ingress: 'OVH:<INGRESS>'
291
291
  }
292
292
  };
293
293
  const valuesMerged = YAML.dump(deepmerge(valuesSvc, valuesAll), {
Binary file
@@ -284,10 +284,10 @@ ahoy.forEach(dir => {
284
284
  const valuesAll = YAML.load(valuesOut);
285
285
  const valuesSvc = {
286
286
  service: {
287
- PROJECT_ID: 'OVH:<PROJECT_ID>',
288
- PROJECT_NAME: 'OVH:<PROJECT_NAME>',
289
- HOST: 'OVH:<HOST>',
290
- INGRESS: 'OVH:<INGRESS>'
287
+ project_id: 'OVH:<PROJECT_ID>',
288
+ project_name: 'OVH:<PROJECT_NAME>',
289
+ host: 'OVH:<HOST>',
290
+ ingress: 'OVH:<INGRESS>'
291
291
  }
292
292
  };
293
293
  const valuesMerged = YAML.dump(deepmerge(valuesSvc, valuesAll), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.8.8",
3
+ "version": "2.8.9",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -64,7 +64,7 @@
64
64
  "inquirer": "^8.2.0",
65
65
  "js-yaml": "^4.1.0",
66
66
  "ncp": "^2.0.0",
67
- "npm-check-updates": "^12.0.2",
67
+ "npm-check-updates": "^12.0.5",
68
68
  "npm-registry-fetch": "^11.0.0",
69
69
  "open": "^8.4.0",
70
70
  "ora": "^5.4.1",
@@ -75,10 +75,10 @@
75
75
  },
76
76
  "devDependencies": {
77
77
  "@babel/cli": "^7.16.0",
78
- "@babel/core": "^7.16.0",
79
- "@babel/node": "^7.16.0",
78
+ "@babel/core": "^7.16.5",
79
+ "@babel/node": "^7.16.5",
80
80
  "@leverege/babel-preset-leverege-node": "^2.0.0",
81
81
  "@leverege/eslint-config-leverege": "^3.0.1",
82
- "npm": "^8.2.0"
82
+ "npm": "^8.3.0"
83
83
  }
84
84
  }
@@ -0,0 +1,4 @@
1
+ name: qmed-qvue-ingestor
2
+ version: 1.4.9
3
+ apiVersion: v2
4
+ icon: https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.svg
@@ -0,0 +1,52 @@
1
+ -------------------------------------------------------------------------------
2
+
3
+ Service: {{ .Chart.Name }}
4
+
5
+ This service relies on the presence of a Service Account (SA) to define its
6
+ permissions on the clusters that it is deployed to. Verify or create an SA
7
+ with the following name and IAM roles:
8
+
9
+ SA name => {{ .Chart.Name }}
10
+ IAM roles => pubsub.editor
11
+ secretmanager.secretAccessor
12
+
13
+ {{- if .Values.workloadIdentity.disabled }}
14
+
15
+ Workload Identity is disabled for this service, most likely because this is
16
+ running on a legacy cluster which does not support it. In order for this
17
+ service to function properly a set of JSON keys will need to be generated and
18
+ then stored as a secret using this syntax:
19
+
20
+ cat <keyfileName> | kubectl create secret generic {{ .Chart.Name }}-sa-key \
21
+ --from-file=key.json=/dev/stdin
22
+
23
+ {{- else }}
24
+
25
+ Workload identity is enabled for this service, therefore the SA must have the
26
+ proper IAM policy bound to it. This can be verified by running:
27
+
28
+ $ gcloud iam service-accounts get-iam-policy \
29
+ --project {{ .Values.config.PROJECT_ID }} \
30
+ {{ .Chart.Name }}@{{ .Values.config.PROJECT_ID }}.iam.gserviceaccount.com
31
+
32
+ which should return something resembling:
33
+
34
+ bindings:
35
+ - members:
36
+ - serviceAccount:{{ .Values.config.PROJECT_ID }}.svc.id.goog[default/<service name>]
37
+ role: roles/iam.workloadIdentityUser
38
+ etag: <uuencoded tag>
39
+ version: 1
40
+
41
+ If the role of roles/iam.workloadIdentityUser does not appear on the SA then
42
+ run the following command to add it:
43
+
44
+ $ gcloud iam service-accounts add-iam-policy-binding \
45
+ --project {{ .Values.config.PROJECT_ID }} \
46
+ --role roles/iam.workloadIdentityUser \
47
+ --member "serviceAccount:{{ .Values.config.PROJECT_ID }}.svc.id.goog[default/{{ .Chart.Name }}]" \
48
+ {{ .Chart.Name }}@{{ .Values.config.PROJECT_ID }}.iam.gserviceaccount.com
49
+
50
+ {{- end }}
51
+
52
+ -------------------------------------------------------------------------------
@@ -0,0 +1,11 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: {{ .Chart.Name }}-configs
5
+ labels:
6
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
7
+ app: "{{ .Chart.Name }}"
8
+ heritage: "{{ .Release.Service }}"
9
+ release: "{{ .Release.Name }}"
10
+ data:
11
+ {{- toYaml .Values.config | nindent 2 }}
@@ -0,0 +1,103 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ .Chart.Name }}
5
+ labels:
6
+ redis-client: "true"
7
+ app: {{ .Chart.Name }}
8
+ chart/version: {{ .Chart.Version }}
9
+ chart/appVersion: {{ .Values.image.VERSION }}
10
+ spec:
11
+ selector:
12
+ matchLabels:
13
+ app: {{ .Chart.Name }}
14
+ template:
15
+ metadata:
16
+ labels:
17
+ app: {{ .Chart.Name }}
18
+ chart/version: {{ .Chart.Version }}
19
+ chart/appVersion: {{ .Values.image.VERSION }}
20
+ redis-client: "true"
21
+ annotations:
22
+ checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
23
+ prometheus.io/port: "5111"
24
+ prometheus.io/scrape: "true"
25
+ configmap.reloader.stakater.com/reload: "default-configs"
26
+ iam.roles: |
27
+ "pubsub.editor"
28
+ "secretManager.secretAccessor"
29
+ spec:
30
+ serviceAccountName: {{ .Chart.Name }}
31
+ volumes:
32
+ - name: tmpfs
33
+ emptyDir: {}
34
+ {{- if .Values.workloadIdentity.disabled }}
35
+ - name: google-cloud-key
36
+ secret:
37
+ secretName: {{ .Chart.Name }}-sa-key
38
+ {{- end }}
39
+ {{- if .Values.preemptible.enabled }}
40
+ tolerations:
41
+ - key: "preemptible"
42
+ operator: "Equal"
43
+ value: "true"
44
+ effect: "NoSchedule"
45
+ affinity:
46
+ nodeAffinity:
47
+ preferredDuringSchedulingIgnoredDuringExecution:
48
+ - preference:
49
+ matchExpressions:
50
+ - key: cloud.google.com/gke-preemptible
51
+ operator: Exists
52
+ weight: 100
53
+ {{- end }}
54
+ containers:
55
+ - name: {{ .Chart.Name }}
56
+ imagePullPolicy: IfNotPresent
57
+ image: gcr.io/leverege-docker-images/{{ .Chart.Name }}:{{ .Values.image.VERSION }}
58
+ securityContext:
59
+ readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFs }}
60
+ runAsNonRoot: true
61
+ runAsUser: 1000
62
+ allowPrivilegeEscalation: false
63
+ {{- if .Values.probes }}{{ if .Values.probes.enabled }}
64
+ readinessProbe:
65
+ httpGet:
66
+ path: /healthz
67
+ port: api
68
+ initialDelaySeconds: 10
69
+ livenessProbe:
70
+ httpGet:
71
+ path: /livenessProbe
72
+ port: api
73
+ initialDelaySeconds: 15
74
+ periodSeconds: 60
75
+ {{- end }}{{ end }}
76
+ resources:
77
+ limits:
78
+ cpu: "100m"
79
+ memory: "256Mi"
80
+ # requests:
81
+ # cpu: "100m"
82
+ # memory: "128Mi"
83
+ ports:
84
+ {{- if .Values.config.port }}
85
+ - name: api
86
+ containerPort: {{ .Values.config.port }}
87
+ protocol: TCP
88
+ {{- end }}
89
+ - name: node-metrics
90
+ containerPort: 5111
91
+ volumeMounts:
92
+ - name: tmpfs
93
+ mountPath: "/tmp"
94
+ envFrom:
95
+ - configMapRef:
96
+ name: default-configs
97
+ - configMapRef:
98
+ name: {{ .Chart.Name }}-configs
99
+ env:
100
+ {{- if .Values.workloadIdentity.disabled }}
101
+ - name: GOOGLE_APPLICATION_CREDENTIALS
102
+ value: /var/secrets/google/key.json
103
+ {{- end }}
@@ -0,0 +1,12 @@
1
+ apiVersion: autoscaling/v1
2
+ kind: HorizontalPodAutoscaler
3
+ metadata:
4
+ name: {{ .Chart.Name }}
5
+ spec:
6
+ scaleTargetRef:
7
+ apiVersion: apps/v1
8
+ kind: Deployment
9
+ name: {{ .Chart.Name }}
10
+ minReplicas: {{ .Values.horizontalScaler.minReplicas }}
11
+ maxReplicas: {{ .Values.horizontalScaler.maxReplicas }}
12
+ targetCPUUtilizationPercentage: {{ .Values.horizontalScaler.maxCPU }}
@@ -0,0 +1,17 @@
1
+ apiVersion: networking.k8s.io/v1
2
+ kind: Ingress
3
+ metadata:
4
+ name: {{ .Chart.Name }}
5
+ labels:
6
+ app: {{ .Chart.Name }}
7
+ annotations:
8
+ # kubernetes.io/ingress.allow-http: "false"
9
+ kubernetes.io/ingress.global-static-ip-name: {{ .Chart.Name }}
10
+ spec:
11
+ tls:
12
+ - secretName: {{ .Values.ingress.secretName }}
13
+ defaultBackend:
14
+ service:
15
+ name: {{ .Chart.Name }}
16
+ port:
17
+ number: {{ .Values.config.port }}
@@ -0,0 +1,9 @@
1
+ apiVersion: policy/v1beta1
2
+ kind: PodDisruptionBudget
3
+ metadata:
4
+ name: {{ .Chart.Name }}
5
+ spec:
6
+ minAvailable: 75%
7
+ selector:
8
+ matchLabels:
9
+ app: app
@@ -0,0 +1,13 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: {{ .Chart.Name }}
5
+ spec:
6
+ type: NodePort
7
+ selector:
8
+ app: {{ .Chart.Name }}
9
+ ports:
10
+ - name: {{ .Chart.Name }}
11
+ protocol: TCP
12
+ port: {{ .Values.config.port }}
13
+ targetPort: {{ .Values.config.port }}
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: ServiceAccount
3
+ metadata:
4
+ annotations:
5
+ iam.gke.io/gcp-service-account: {{ .Chart.Name }}@{{ .Values.config.PROJECT_ID }}.iam.gserviceaccount.com
6
+ name: {{ .Chart.Name }}
7
+ labels:
8
+ app: {{ .Chart.Name }}
9
+ chart/version: {{ .Chart.Version }}
10
+ chart/appVersion: {{ .Values.image.VERSION }}
@@ -0,0 +1,44 @@
1
+ image:
2
+ VERSION: v0.4.4
3
+
4
+ config:
5
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
+ BLUEPRINT_ID: needs-to-be-set
7
+ NETWORK_ID: needs-to-be-set
8
+ SYSTEM_ID: needs-to-be-set
9
+ IMAGINE_URL: needs-to-be-set
10
+ ALIAS_KEY: needs-to-be-set
11
+ INGESTION_TOPIC: needs-to-be-set
12
+ port: 8383
13
+ logExpressRequests: false
14
+
15
+ ingress:
16
+ domain: leverege.net
17
+ secretName: leverege-net-ssl-2034
18
+
19
+ preemptible:
20
+ enabled: true
21
+
22
+ probes:
23
+ enabled: true
24
+
25
+ redisClient:
26
+ label: true
27
+
28
+ securityContext:
29
+ readOnlyRootFs: true
30
+
31
+ horizontalScaler:
32
+ minReplicas: 1
33
+ maxReplicas: 3
34
+ maxCPU: 75
35
+
36
+ affinity: {}
37
+
38
+ nodeSelector: {}
39
+
40
+ podAnnotations: {}
41
+
42
+ tolerations: []
43
+
44
+ workloadIdentity: {}
package/src/helmup CHANGED
@@ -33,6 +33,7 @@ SYSTEM=(
33
33
  monitoring
34
34
  preemptible-killer
35
35
  reloader
36
+ cert-manager
36
37
  traefik
37
38
  velero
38
39
  )
@@ -303,9 +304,34 @@ NEED_TRAEFIK_SECRET
303
304
  --from-literal=dns-token=$TOKEN
304
305
  fi
305
306
 
307
+ TRAEFIK_HA_YAML="traefik/traefik-ha-values.yaml"
308
+ if [ ! -f "$TRAEFIK_HA_YAML" ];
309
+ then
310
+ cat<<TRAEFIK_CFG>>"$TRAEFIK_HA_YAML"
311
+ additionalArguments:
312
+ - "--accesslog=true"
313
+ - "--accesslog.format=json"
314
+ - "--log.level=WARN"
315
+ - "--metrics.prometheus=true"
316
+ - "--metrics.prometheus.entryPoint=metrics"
317
+ - "--entryPoints.metrics.address=:8082"
318
+ - "--api.dashboard=true"
319
+
320
+ deployment:
321
+ replicas: 3
322
+ podAnnotations:
323
+ prometheus.io/port: '8082'
324
+ prometheus.io/scrape: 'true'
325
+
326
+ #service:
327
+ # spec:
328
+ # loadBalancerIP: xx.xx.xx.xx
329
+ TRAEFIK_CFG
330
+ fi
331
+
306
332
  helm upgrade --install traefik traefik/traefik \
307
333
  --namespace traefik \
308
- --values traefik/traefik-values.yaml
334
+ --values $TRAEFIK_HA_YAML
309
335
  }
310
336
 
311
337
  function installVelero() {
package/src/overwhelm.js CHANGED
@@ -239,10 +239,10 @@ ahoy.forEach( ( dir ) => {
239
239
  const valuesAll = YAML.load( valuesOut )
240
240
  const valuesSvc = {
241
241
  service : {
242
- PROJECT_ID : 'OVH:<PROJECT_ID>',
243
- PROJECT_NAME : 'OVH:<PROJECT_NAME>',
244
- HOST : 'OVH:<HOST>',
245
- INGRESS : 'OVH:<INGRESS>',
242
+ project_id : 'OVH:<PROJECT_ID>',
243
+ project_name : 'OVH:<PROJECT_NAME>',
244
+ host : 'OVH:<HOST>',
245
+ ingress : 'OVH:<INGRESS>',
246
246
  }
247
247
  }
248
248
  const valuesMerged = YAML.dump( deepmerge( valuesSvc, valuesAll ), { quotingType : '"' } )
@@ -0,0 +1,13 @@
1
+ {
2
+ "title": "Leverege Pub/Sub Access (rw)",
3
+ "description": "Read/Write access to the Pub/Sub messaging service",
4
+ "includedPermissions": [
5
+ "pubsub.subscriptions.consume",
6
+ "pubsub.subscriptions.create",
7
+ "pubsub.topics.attachSubscription",
8
+ "pubsub.topics.create",
9
+ "pubsub.topics.list",
10
+ "pubsub.topics.publish"
11
+ ],
12
+ "stage": "BETA"
13
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "title": "Leverege Secret Manager Access (ro)",
3
+ "description": "Read only access to the Secrets in Secrets Manager",
4
+ "includedPermissions": [
5
+ "secretmanager.versions.access"
6
+ ],
7
+ "stage": "BETA"
8
+ }
File without changes