Skip to content

Commit b8b4198

Browse files
author
Maurice Faber
committed
feat: email receiver for alertmanager
refactor: alertmanager receivers refactor: no-keycloak now correctly handled, cleaned upi
1 parent edb31f7 commit b8b4198

27 files changed

+290
-202
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
"esbenp",
5858
"foxundermoon",
5959
"gcloud",
60+
"gitea",
6061
"gitops",
62+
"gogs",
6163
"grafana",
6264
"grpc",
6365
"helmfile",

.demo/env/secrets.settings.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ clouds:
2121
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dnsmanager%40otomi-cloud.iam.gserviceaccount.com"
2222
}
2323
alerts:
24+
home:
25+
slack:
26+
url: https://hooks.slack.com/services/id
2427
slack:
25-
url: https://hooks.slack.com/services/x/y/z
28+
url: https://hooks.slack.com/services/id

.demo/env/settings.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ otomi:
22
mode: ce
33
isManaged: true
44
isMultitenant: true
5-
isRedkubesMonitored: true
5+
isHomeMonitored: true
66
teamPrefix: team-
77
hasCloudLB: false
88
customer:
99
name: demo
1010
oidc:
11-
clientID: demo
11+
clientID: otomi
1212
idp:
1313
issuer: https://login.microsoftonline.com/57a3f6ea-7e70-4260-acb4-e06ce452f695
1414
tenantID: 57a3f6ea-7e70-4260-acb4-e06ce452f695
@@ -17,4 +17,10 @@ oidc:
1717
teamAdminGroupID: someTeamAdminGroupID
1818
scope: openid email profile
1919
alerts:
20-
receiver: slack
20+
drone: slack
21+
home:
22+
receivers: [slack]
23+
slack:
24+
channel: mon-otomi
25+
channelCrit: mon-otomi-crit
26+
receivers: [slack]

.values/.prettierrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ singleQuote: true
55
printWidth: 120
66
overrides:
77
- files:
8-
- '*.yaml'
9-
- '*.dec'
8+
- 'env/**/*.yaml'
9+
- 'env/**/*.dec'
1010
options:
1111
tabWidth: 4
1212
useTabs: true

.values/.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
"[docker,shell]": {
33
"editor.defaultFormatter": "foxundermoon.shell-format"
44
},
5-
"[json,md,yaml,enc]": {
5+
"[json,md,yaml,dec]": {
66
"editor.defaultFormatter": "esbenp.prettier-vscode"
77
},
88
"editor.formatOnPaste": false,
99
"editor.formatOnSave": true,
1010
"files.associations": {
1111
"*.yml": "yaml",
12-
"*.yaml.enc": "yaml",
12+
"*.yaml.dec": "yaml",
1313
".secrets*": "shellscript",
1414
"otomi": "shellscript",
1515
"aliases": "shellscript"
1616
},
17+
"prettier.enable": true,
1718
"sops.defaults.gcpCredentialsPath": "gcp-key.json",
1819
"yaml.schemas": {
1920
".vscode/values-schema.yaml": "env/*.yaml"

bin/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ hf() {
3333
}
3434

3535
hf_values() {
36-
[ "${VERBOSE-'true'}" = 'true' ] && quiet='--quiet'
36+
[ "${VERBOSE-'false'}" = 'false' ] && quiet='--quiet'
3737
helmfile ${quiet-} -e "$CLOUD-$CLUSTER" -f helmfile.tpl/helmfile-dump.yaml build | grep -Ev $helmfileOutputHide | sed -e $replacePathsPattern |
3838
yq read -P - 'releases[0].values[0]'
3939
}

bin/crypt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ command=$1
88

99
function rotate() {
1010
cd $ENV_DIR/env >/dev/null
11-
find . -type f -name '*.secrets.yaml.enc' -exec bash -c "sops --input-type=yaml --output-type yaml -r {} > {}" \;
11+
find . -type f -name 'secrets.*.yaml' -exec bash -c "sops --input-type=yaml --output-type yaml -r {} > {}" \;
1212
cd - >/dev/null
1313
}
1414

bin/gen-drone.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ ENV_DIR=${ENV_DIR:-./env}
88
. bin/common.sh
99
. bin/colors.sh
1010

11+
prepare_crypt
1112
readonly values=$(hf_values)
12-
readonly receiver=$(echo "$values" | yq r - alerts.receiver)
13+
readonly raw_receiver=$(echo "$values" | yq r - alerts.drone)
14+
readonly receiver=${raw_receiver:-'slack'}
1315
readonly templatePath=$PWD/tpl/.drone.tpl.$receiver.yml
1416
readonly customer_name=$(customer_name)
1517

bin/otomi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ validate_cluster_env() {
157157
local err
158158
[[ -z "$CLOUD" ]] && echo "Error: The CLOUD environment variable is not set" >&2 && err=1
159159
[[ -z "$CLUSTER" ]] && echo "Error: The CLUSTER environment variable is not set" >&2 && err=1
160-
[[ ! -z "$err" ]] && exit 2
160+
[[ -n "$err" ]] && exit 2
161161
return 0
162162
}
163163

charts/team-ns/templates/istio-virtualservices.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ spec:
7979
set:
8080
X-Forwarded-Proto: https
8181
---
82-
{{- if and (not (hasKey $s "isPublic")) (hasKey $s "authz") }}
82+
{{- if and $v.hasKeycloak (not (hasKey $s "isPublic")) (hasKey $s "authz") }}
8383
{{- $workload := ($s.authz.workload | toYaml | replace "__TEAM" $v.teamId) }}
8484
apiVersion: security.istio.io/v1beta1
8585
kind: RequestAuthentication

0 commit comments

Comments
 (0)