@leverege/build-tools 2.8.11 → 2.8.13
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/repo-init/RepoInit.js +3 -4
- package/lib/server/repo-init/config.tgz +0 -0
- package/lib/server/unleash.js +8 -1
- package/lib/web/unleash.js +8 -1
- package/package.json +9 -8
- package/src/anchor +41 -0
- package/src/dockreate +1 -1
- package/src/pkgck +16 -3
- package/src/unleash.js +8 -2
- package/src/helm-starters/chart/Chart.yaml +0 -4
- package/src/helm-starters/chart/templates/NOTES.txt +0 -52
- package/src/helm-starters/chart/templates/configmap.yaml +0 -11
- package/src/helm-starters/chart/templates/deployment.yaml +0 -103
- package/src/helm-starters/chart/templates/hpa.yaml +0 -12
- package/src/helm-starters/chart/templates/ingress.yaml +0 -17
- package/src/helm-starters/chart/templates/pdb.yaml +0 -9
- package/src/helm-starters/chart/templates/service.yaml +0 -13
- package/src/helm-starters/chart/templates/serviceaccount.yaml +0 -10
- package/src/helm-starters/chart/values.yaml +0 -44
- package/src/sa-tools/imp-sa +0 -26
- package/src/sa-tools/roles/LeveregePubSubAccess.json +0 -13
- package/src/sa-tools/roles/LeveregeSecretManagerAccess.json +0 -8
- package/src/sa-tools/sh-make-sa +0 -58
|
@@ -89,10 +89,10 @@ const doVersionChecks = async () => {
|
|
|
89
89
|
VersionCheck.validate({
|
|
90
90
|
current: process.version,
|
|
91
91
|
// this is the node version
|
|
92
|
-
minimum: '12.
|
|
93
|
-
maximum: '
|
|
92
|
+
minimum: '16.12.0',
|
|
93
|
+
maximum: '17',
|
|
94
94
|
// must be less than this
|
|
95
|
-
preferred: '
|
|
95
|
+
preferred: '16.13.0'
|
|
96
96
|
});
|
|
97
97
|
} catch (err) {
|
|
98
98
|
console.log(err);
|
|
@@ -168,7 +168,6 @@ const start = async () => {
|
|
|
168
168
|
- add / flesh out remaining templates
|
|
169
169
|
- express-server
|
|
170
170
|
- library
|
|
171
|
-
- molten-ui
|
|
172
171
|
- ui-lib
|
|
173
172
|
- ui-???
|
|
174
173
|
`);
|
|
Binary file
|
package/lib/server/unleash.js
CHANGED
|
@@ -8,7 +8,12 @@ const SimpleGit = require('simple-git');
|
|
|
8
8
|
const git = new SimpleGit();
|
|
9
9
|
|
|
10
10
|
const getCurrentBranchName = async () => {
|
|
11
|
-
const branchInfo = await git.branch();
|
|
11
|
+
const branchInfo = await git.branch(); // first check to see if there are no branches - new repo?
|
|
12
|
+
|
|
13
|
+
if (Object.keys(branchInfo.branches).length === 0) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
return Object.entries(branchInfo.branches).find(([name, info]) => info.current)[0];
|
|
13
18
|
};
|
|
14
19
|
|
|
@@ -27,6 +32,8 @@ const npmRunner = async script => {
|
|
|
27
32
|
} catch (err) {
|
|
28
33
|
process.exit(1);
|
|
29
34
|
}
|
|
35
|
+
|
|
36
|
+
return undefined;
|
|
30
37
|
};
|
|
31
38
|
|
|
32
39
|
(async () => {
|
package/lib/web/unleash.js
CHANGED
|
@@ -8,7 +8,12 @@ const SimpleGit = require('simple-git');
|
|
|
8
8
|
const git = new SimpleGit();
|
|
9
9
|
|
|
10
10
|
const getCurrentBranchName = async () => {
|
|
11
|
-
const branchInfo = await git.branch();
|
|
11
|
+
const branchInfo = await git.branch(); // first check to see if there are no branches - new repo?
|
|
12
|
+
|
|
13
|
+
if (Object.keys(branchInfo.branches).length === 0) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
return Object.entries(branchInfo.branches).find(([name, info]) => info.current)[0];
|
|
13
18
|
};
|
|
14
19
|
|
|
@@ -27,6 +32,8 @@ const npmRunner = async script => {
|
|
|
27
32
|
} catch (err) {
|
|
28
33
|
process.exit(1);
|
|
29
34
|
}
|
|
35
|
+
|
|
36
|
+
return undefined;
|
|
30
37
|
};
|
|
31
38
|
|
|
32
39
|
(async () => {
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.13",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+ssh://git@bitbucket.org/leverege/build-tools.git"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"build": "npm run compile",
|
|
8
12
|
"clean": "rm -rf lib",
|
|
9
13
|
"compile": "npm run clean && npm run compile_server && npm run compile_web",
|
|
10
14
|
"compile_server": "NODE_ENV=server babel -d lib/server src/ && npm run repo_init_publisher",
|
|
11
15
|
"compile_web": "NODE_ENV=web babel -d lib/web src/",
|
|
12
|
-
"licenseCheck": "license-checker --summary --failOn GPL",
|
|
13
|
-
"npm-check-updates": "npm-check-updates -i",
|
|
14
16
|
"postinstall": "src/npm-scripts/postinstall.js",
|
|
15
17
|
"prepublintOnly": "npm run lint && npm run build",
|
|
16
18
|
"prepublishOnly": "npm run compile",
|
|
@@ -64,7 +66,6 @@
|
|
|
64
66
|
"inquirer": "^8.2.0",
|
|
65
67
|
"js-yaml": "^4.1.0",
|
|
66
68
|
"ncp": "^2.0.0",
|
|
67
|
-
"npm-check-updates": "^12.0.5",
|
|
68
69
|
"npm-registry-fetch": "^11.0.0",
|
|
69
70
|
"open": "^8.4.0",
|
|
70
71
|
"ora": "^5.4.1",
|
|
@@ -74,11 +75,11 @@
|
|
|
74
75
|
"simple-git": "^2.48.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
|
-
"@babel/cli": "^7.16.
|
|
78
|
-
"@babel/core": "^7.16.
|
|
79
|
-
"@babel/node": "^7.16.
|
|
78
|
+
"@babel/cli": "^7.16.8",
|
|
79
|
+
"@babel/core": "^7.16.7",
|
|
80
|
+
"@babel/node": "^7.16.8",
|
|
80
81
|
"@leverege/babel-preset-leverege-node": "^2.0.0",
|
|
81
82
|
"@leverege/eslint-config-leverege": "^3.0.1",
|
|
82
|
-
"npm": "^8.3.
|
|
83
|
+
"npm": "^8.3.1"
|
|
83
84
|
}
|
|
84
85
|
}
|
package/src/anchor
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Load the standard helper functions
|
|
4
|
+
. `build-tools --bashfun`
|
|
5
|
+
|
|
6
|
+
if [ -z "$1" ] || [ -z "$2" ];
|
|
7
|
+
then
|
|
8
|
+
cat<<USAGE
|
|
9
|
+
|
|
10
|
+
$(color g "Usage: anchor <service name> <chart version>\n")
|
|
11
|
+
|
|
12
|
+
USAGE
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
SERVICE=$1
|
|
17
|
+
VERSION=$2
|
|
18
|
+
ANCHOR="${SERVICE}/Chart-${VERSION}"
|
|
19
|
+
|
|
20
|
+
if compgen -G "${SERVICE}/Chart-*" > /dev/null ;
|
|
21
|
+
then
|
|
22
|
+
cat<<ALREADY_ANCHORED
|
|
23
|
+
|
|
24
|
+
$(color r "$SERVICE is already anchored")
|
|
25
|
+
$(color y "Go remove the existing anchor from ${SERVICE} and try again")
|
|
26
|
+
|
|
27
|
+
`/bin/ls ${SERVICE}/Chart*`
|
|
28
|
+
|
|
29
|
+
ALREADY_ANCHORED
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
printf "Locking $SERVICE chart version at $VERSION\n"
|
|
34
|
+
touch ${ANCHOR}
|
|
35
|
+
|
|
36
|
+
if [ -f "${ANCHOR}" ];
|
|
37
|
+
then
|
|
38
|
+
printf "Service locked with creation of ${ANCHOR}\n"
|
|
39
|
+
else
|
|
40
|
+
printf "***ERROR: failed to create anchor ${ANCHOR}\n"
|
|
41
|
+
fi
|
package/src/dockreate
CHANGED
|
@@ -78,7 +78,7 @@ RUN apk --no-cache add openssh-client && \
|
|
|
78
78
|
apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
|
|
79
79
|
libstdc++ linux-headers make ${apkadds} && \
|
|
80
80
|
npm install -g npm@8 && \
|
|
81
|
-
npm ci --only
|
|
81
|
+
npm ci --only=production --ignore-scripts ${npmlogging} && \
|
|
82
82
|
rm -f /usr/src/app/.npmrc /root/.ssh/*
|
|
83
83
|
|
|
84
84
|
# --------------------------------------------------------------
|
package/src/pkgck
CHANGED
|
@@ -9,6 +9,10 @@ good() {
|
|
|
9
9
|
printf "\e[32m✔${C_off}"
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
meh() {
|
|
13
|
+
printf "\e[36m✩${C_off}"
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
bad() {
|
|
13
17
|
printf "\e[31m✘${C_off}"
|
|
14
18
|
}
|
|
@@ -31,6 +35,7 @@ check_babel () {
|
|
|
31
35
|
local C_stat=$(bad)
|
|
32
36
|
[ -f .babelrc ] && grep --silent @leverege/babel-preset-leverege-node .babelrc
|
|
33
37
|
[ $? -eq 0 ] && C_stat=$(good)
|
|
38
|
+
[ ! -f .babelrc ] && C_stat=$(meh)
|
|
34
39
|
printf $C_stat
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -48,7 +53,7 @@ check_eslint () {
|
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
check_license () {
|
|
51
|
-
local C_stat=$(
|
|
56
|
+
local C_stat=$(meh)
|
|
52
57
|
local lic="`node -p \"require('./package.json').scripts.licenseCheck !== undefined\"`"
|
|
53
58
|
[ $lic == true ] && C_stat=$(good)
|
|
54
59
|
printf $C_stat
|
|
@@ -93,6 +98,13 @@ check_scope() {
|
|
|
93
98
|
printf "${result}${C_off}"
|
|
94
99
|
}
|
|
95
100
|
|
|
101
|
+
check_ESM() {
|
|
102
|
+
local C_stat=$(bad)
|
|
103
|
+
jstype="`getjson --file package.json --key type`"
|
|
104
|
+
[[ "$jstype" == "module" ]] && C_stat=$(good)
|
|
105
|
+
printf $C_stat
|
|
106
|
+
}
|
|
107
|
+
|
|
96
108
|
repos=0
|
|
97
109
|
check_repo() {
|
|
98
110
|
local dir=$1
|
|
@@ -118,10 +130,11 @@ check_repo() {
|
|
|
118
130
|
local babel7=$(check_babel)
|
|
119
131
|
local circle=$(check_circle)
|
|
120
132
|
local eslint=$(check_eslint)
|
|
133
|
+
local esmlib=$(check_ESM)
|
|
121
134
|
local license=$(check_license)
|
|
122
135
|
local scoped=$(check_scope)
|
|
123
|
-
[ $(( $repos % 15)) -eq 0 ] && printf "\n%35s pkg git cln scop cir lic
|
|
124
|
-
printf "%32s: %-8s %-16s %s %8s %s %s %s %s %s\n" $dir $pkgver $(check_git_version $gitver $pkgver) $localmods $scoped $circle $license $
|
|
136
|
+
[ $(( $repos % 15)) -eq 0 ] && printf "\n%35s pkg git cln scop cir lic ESM bl7\n"
|
|
137
|
+
printf "%32s: %-8s %-16s %s %8s %s %s %s %s %s\n" $dir $pkgver $(check_git_version $gitver $pkgver) $localmods $scoped $circle $license $esmlib $babel7 "$needspush"
|
|
125
138
|
let "repos++"
|
|
126
139
|
cd - &> /dev/null
|
|
127
140
|
}
|
package/src/unleash.js
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const execa = require( 'execa' )
|
|
4
4
|
const SimpleGit = require( 'simple-git' )
|
|
5
|
+
|
|
5
6
|
const git = new SimpleGit()
|
|
6
7
|
|
|
7
8
|
const getCurrentBranchName = async () => {
|
|
8
9
|
const branchInfo = await git.branch()
|
|
10
|
+
|
|
11
|
+
// first check to see if there are no branches - new repo?
|
|
12
|
+
if ( Object.keys( branchInfo.branches ).length === 0 ) { return '' }
|
|
13
|
+
|
|
9
14
|
return Object
|
|
10
15
|
.entries( branchInfo.branches )
|
|
11
16
|
.find( ( [ name, info ] ) => ( info.current ) )[0]
|
|
@@ -24,13 +29,14 @@ const npmRunner = async ( script ) => {
|
|
|
24
29
|
} catch ( err ) {
|
|
25
30
|
process.exit( 1 )
|
|
26
31
|
}
|
|
32
|
+
return undefined
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
( async () => {
|
|
30
36
|
if ( await isProtected() ) {
|
|
31
37
|
const script = [ 'test', 'lint' ]
|
|
32
|
-
for( let i = 0; i < script.length; i++ ) {
|
|
33
|
-
await npmRunner( script[
|
|
38
|
+
for ( let i = 0; i < script.length; i++ ) {
|
|
39
|
+
await npmRunner( script[i] )
|
|
34
40
|
}
|
|
35
41
|
} else {
|
|
36
42
|
process.exit( 0 )
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
-------------------------------------------------------------------------------
|
|
@@ -1,11 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,103 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,12 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,17 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,10 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,44 +0,0 @@
|
|
|
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/sa-tools/imp-sa
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
IMPERSONATE='gcloud config set auth/impersonate_service_account'
|
|
4
|
-
impersonate() {
|
|
5
|
-
sa=$1
|
|
6
|
-
echo "Impersonating $sa"
|
|
7
|
-
$IMPERSONATE $sa
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
case $1 in
|
|
11
|
-
terraform)
|
|
12
|
-
impersonate terraformer@leverege-dev-john.iam.gserviceaccount.com
|
|
13
|
-
;;
|
|
14
|
-
gke)
|
|
15
|
-
impersonate k8s@project.iam.gserviceaccount.com
|
|
16
|
-
;;
|
|
17
|
-
admin)
|
|
18
|
-
impersonate admin@other-project.iam.gserviceaccount.com
|
|
19
|
-
;;
|
|
20
|
-
clear)
|
|
21
|
-
gcloud config unset auth/impersonate_service_account
|
|
22
|
-
;;
|
|
23
|
-
*)
|
|
24
|
-
echo "Usage: Updates impersonated service account"
|
|
25
|
-
echo " imp-sa [gke|admin|clear]"
|
|
26
|
-
esac
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
package/src/sa-tools/sh-make-sa
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
SVC_PROJ="leverege-dev-john"
|
|
4
|
-
|
|
5
|
-
SVC_NAME="terraform"
|
|
6
|
-
SVC_ACCT="${SVC_NAME}@${SVC_PROJ}.iam.gserviceaccount.com"
|
|
7
|
-
|
|
8
|
-
function countdown() {
|
|
9
|
-
local SEC=${1}
|
|
10
|
-
shift
|
|
11
|
-
local MSG=${@}
|
|
12
|
-
while [ $SEC -ne 0 ];
|
|
13
|
-
do
|
|
14
|
-
printf "\r\033[KWaiting %.d seconds $MSG" $((SEC--))
|
|
15
|
-
sleep 1
|
|
16
|
-
done
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
gcloud config unset auth/impersonate_service_account
|
|
20
|
-
|
|
21
|
-
gcloud iam service-accounts create ${SVC_NAME} \
|
|
22
|
-
--project=${SVC_PROJ} --quiet \
|
|
23
|
-
--description="${SVC_NAME} SA" \
|
|
24
|
-
--display-name="${SVC_NAME}" &> /dev/null
|
|
25
|
-
|
|
26
|
-
gcloud projects add-iam-policy-binding ${SVC_PROJ} \
|
|
27
|
-
--project=${SVC_PROJ} --quiet \
|
|
28
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
29
|
-
--role=roles/editor &> /dev/null
|
|
30
|
-
|
|
31
|
-
gcloud projects add-iam-policy-binding ${SVC_PROJ} \
|
|
32
|
-
--project=${SVC_PROJ} --quiet \
|
|
33
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
34
|
-
--role=roles/iam.securityAdmin &> /dev/null
|
|
35
|
-
|
|
36
|
-
gcloud projects add-iam-policy-binding ${SVC_PROJ} \
|
|
37
|
-
--project=${SVC_PROJ} --quiet \
|
|
38
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
39
|
-
--role=roles/iam.serviceAccountTokenCreator &> /dev/null
|
|
40
|
-
|
|
41
|
-
countdown 30 "will delete ${SVC_NAME} service account"
|
|
42
|
-
|
|
43
|
-
gcloud projects remove-iam-policy-binding ${SVC_PROJ} \
|
|
44
|
-
--project=${SVC_PROJ} --quiet \
|
|
45
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
46
|
-
--role=roles/iam.serviceAccountTokenCreator &> /dev/null
|
|
47
|
-
|
|
48
|
-
gcloud projects remove-iam-policy-binding ${SVC_PROJ} \
|
|
49
|
-
--project=${SVC_PROJ} --quiet \
|
|
50
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
51
|
-
--role=roles/iam.securityAdmin &> /dev/null
|
|
52
|
-
|
|
53
|
-
gcloud projects remove-iam-policy-binding ${SVC_PROJ} \
|
|
54
|
-
--project=${SVC_PROJ} --quiet \
|
|
55
|
-
--member=serviceAccount:${SVC_ACCT} \
|
|
56
|
-
--role=roles/editor &> /dev/null
|
|
57
|
-
|
|
58
|
-
gcloud iam service-accounts delete ${SVC_ACCT} --quiet &> /dev/null
|