Skip to content

Commit 0d0e373

Browse files
committed
style: run pre-commit on all files
1 parent 936ef82 commit 0d0e373

File tree

12 files changed

+99
-58
lines changed

12 files changed

+99
-58
lines changed

.github/workflows/kubernetes-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
go-version: '1.22'
3636

37-
- name: Install `kubectl-validate`
37+
- name: Install kubectl-validate
3838
run: go install -ldflags='-s -w' -race -trimpath sigs.k8s.io/kubectl-validate@latest
3939

4040
- name: Lint manifests

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
- id: check-useless-excludes
1313

1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
15+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
1616
hooks:
1717
- id: check-added-large-files
1818
- id: check-merge-conflict
@@ -24,12 +24,12 @@ repos:
2424
exclude: \.gitignore
2525

2626
- repo: https://github.com/python-jsonschema/check-jsonschema
27-
rev: e2dde74d0702d15f4f43e4f4fb93e301b4bc1e30 # frozen: 0.29.1
27+
rev: 37cd56d9d154dfb0648eaee8efc1040512700c47 # frozen: 0.29.4
2828
hooks:
2929
- id: check-github-workflows
3030

3131
- repo: https://github.com/lyz-code/yamlfix
32-
rev: 47039c9bf8039e81f092c9777a1bc8be32fb7870 # frozen: 1.16.0
32+
rev: 8072181c0f2eab9f2dd8db2eb3b9556d7cd0bd74 # frozen: 1.17.0
3333
hooks:
3434
- id: yamlfix
3535
args:
@@ -44,21 +44,22 @@ repos:
4444
- --strict
4545

4646
- repo: https://github.com/igorshubovych/markdownlint-cli
47-
rev: f295829140d25717bc79368d3f966fc1f67a824f # frozen: v0.41.0
47+
rev: 0d9fcb51a54f3b750b911c054b4bd1a590f1b592 # frozen: v0.43.0
4848
hooks:
4949
- id: markdownlint-fix
5050

51-
- repo: https://github.com/ComPWA/mirrors-taplo
52-
rev: 4ef242b660e0f7c7c953b9d8289e302c3f49bfbc # frozen: v0.8.1
51+
- repo: https://github.com/ComPWA/taplo-pre-commit
52+
rev: 23eab0f0eedcbedebff420f5fdfb284744adc7b3 # frozen: v0.9.3
5353
hooks:
54-
- id: taplo
54+
- id: taplo-format
55+
- id: taplo-lint
5556

5657
- repo: https://github.com/sirwart/ripsecrets
5758
rev: 033ec5192b738b6712701be920cba545c2775050 # frozen: v0.1.8
5859
hooks:
5960
- id: ripsecrets
6061

6162
- repo: https://github.com/crate-ci/typos
62-
rev: cc99b94246254c1b3dfa6ea6111aa212b814a486 # frozen: v1.23.6
63+
rev: b74202f74b4346efdbce7801d187ec57b266bac8 # frozen: v1.27.3
6364
hooks:
6465
- id: typos

docs/bootstrap.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ You will need:
77
- [`doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/) configured with a...
88
- [Digital Ocean Personal Access Token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) with
99
at least the following scopes:
10-
- kubernetes: create, delete
10+
- `kubernetes`: `create`, `delete`
1111
- If replacing an existing cluster:
12-
- load_balancer: read, delete
13-
- database: read, update
12+
- `load_balancer`: `read`, `delete`
13+
- `database`: `read`, `update`
1414
- `PWD` set to the root of this repo
1515
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl)
1616
- [`helm`](https://helm.sh/docs/intro/install/)
@@ -49,11 +49,15 @@ I recommend using the DO Control Panel, but it is possible via the CLI as well.
4949
### With CLI
5050

5151
```bash
52-
databasename=<database-name>
53-
clustername=<cluster-name>
54-
55-
doctl databases firewalls append $(doctl databases list -o json | jq ".[] | select(.name == \"$databasename\") | .id" -r) \
56-
--rule k8s:$(doctl k8s cluster get $clustername --format ID --no-header)
52+
database_name=<database-name>
53+
cluster_name=<cluster-name>
54+
55+
doctl databases firewalls append \
56+
"$(
57+
doctl databases list -o json \
58+
| jq -r ".[] | select(.name == \"$database_name\") | .id"
59+
)" \
60+
--rule "k8s:$(doctl k8s cluster get $cluster_name --format ID --no-header)"
5761
```
5862

5963
## Apply `cert-manager` CRDs
@@ -82,6 +86,6 @@ kubectl apply -f ./kubernetes/manifests -R
8286
## If replacing an existing cluster, destroy old resources
8387

8488
```bash
85-
doctl k8s cluster delete <name>
86-
doctl compute load-balancer delete <id>
89+
doctl k8s cluster delete <cluster-name>
90+
doctl compute load-balancer delete <load-balancer-id>
8791
```
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1+
---
12
apiVersion: v1
23
kind: ConfigMap
4+
35
metadata:
46
name: grafana-default
5-
namespace: grafana
7+
namespace: grafana
8+
69
data:
710
# Root settings
8-
GF_INSTANCE_NAME: "vipyrsec"
9-
GF_SERVER_DOMAIN: "grafana.vipyrsec.com"
10-
GF_SERVER_ROOT_URL: "https://grafana.vipyrsec.com"
11-
GF_SECURITY_COOKIE_SECURE: "true"
11+
GF_INSTANCE_NAME: vipyrsec
12+
GF_SERVER_DOMAIN: grafana.vipyrsec.com
13+
GF_SERVER_ROOT_URL: https://grafana.vipyrsec.com
14+
GF_SECURITY_COOKIE_SECURE: 'true'
1215

1316
# GitHub Auth
14-
GF_AUTH_GITHUB_ENABLED: "true"
15-
GF_AUTH_GITHUB_SCOPES: "user:email,read:org"
17+
GF_AUTH_GITHUB_ENABLED: 'true'
18+
GF_AUTH_GITHUB_SCOPES: user:email,read:org
1619
# IDs can be retrieved via `gh api orgs/python-discord/teams`.
17-
GF_AUTH_GITHUB_TEAM_IDS: "7718058,8310922"
20+
GF_AUTH_GITHUB_TEAM_IDS: 7718058,8310922
1821
GF_AUTH_GITHUB_ROLE_ATTRIBUTE_PATH: "'Admin'"
19-
GF_AUTH_GITHUB_AUTH_URL: "https://github.com/login/oauth/authorize"
20-
GF_AUTH_GITHUB_TOKEN_URL: "https://github.com/login/oauth/access_token"
21-
GF_AUTH_GITHUB_API_URL: "https://api.github.com/user"
22-
GF_AUTH_ALLOW_SIGN_UP: "true"
22+
GF_AUTH_GITHUB_AUTH_URL: https://github.com/login/oauth/authorize
23+
GF_AUTH_GITHUB_TOKEN_URL: https://github.com/login/oauth/access_token
24+
GF_AUTH_GITHUB_API_URL: https://api.github.com/user
25+
GF_AUTH_ALLOW_SIGN_UP: 'true'
2326

2427
# User sign up
25-
GF_USERS_AUTO_ASSIGN_ORG: "true"
26-
GF_USERS_AUTO_ASSIGN_ORG_ID: "1"
28+
GF_USERS_AUTO_ASSIGN_ORG: 'true'
29+
GF_USERS_AUTO_ASSIGN_ORG_ID: '1'

kubernetes/manifests/monitoring/grafana/deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
---
12
apiVersion: apps/v1
23
kind: Deployment
4+
35
metadata:
46
labels:
57
app: grafana
68
name: grafana
7-
namespace: grafana
9+
namespace: grafana
10+
811
spec:
912
selector:
1013
matchLabels:
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1+
---
12
apiVersion: networking.k8s.io/v1
23
kind: Ingress
4+
35
metadata:
46
annotations:
5-
cert-manager.io/cluster-issuer: "letsencrypt"
7+
cert-manager.io/cluster-issuer: letsencrypt
68
name: grafana-ingress
79
namespace: grafana
10+
811
spec:
912
ingressClassName: nginx
1013
tls:
11-
- hosts:
12-
- "grafana.vipyrsec.com"
13-
secretName: grafana-tls
14+
- hosts:
15+
- grafana.vipyrsec.com
16+
secretName: grafana-tls
1417
rules:
15-
- host: grafana.vipyrsec.com
16-
http:
17-
paths:
18-
- path: /
19-
pathType: Prefix
20-
backend:
21-
service:
22-
name: grafana
23-
port:
24-
number: 3000
18+
- host: grafana.vipyrsec.com
19+
http:
20+
paths:
21+
- path: /
22+
pathType: Prefix
23+
backend:
24+
service:
25+
name: grafana
26+
port:
27+
number: 3000
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
apiVersion: v1
23
kind: Namespace
4+
35
metadata:
46
name: grafana

kubernetes/manifests/monitoring/grafana/service.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
12
apiVersion: v1
23
kind: Service
4+
35
metadata:
46
name: grafana
57
namespace: grafana
8+
69
spec:
710
ports:
811
- protocol: TCP

kubernetes/manifests/monitoring/grafana/volume.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
---
12
kind: PersistentVolumeClaim
23
apiVersion: v1
4+
35
metadata:
46
name: grafana-storage
57
namespace: grafana
68
labels:
79
app: grafana
10+
811
spec:
912
storageClassName: do-block-storage
10-
accessModes:
13+
accessModes:
1114
- ReadWriteOnce
1215
resources:
1316
requests:

kubernetes/manifests/monitoring/prometheus/service-account.yaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
11
---
22
kind: ClusterRole
33
apiVersion: rbac.authorization.k8s.io/v1
4+
45
metadata:
56
name: prometheus
7+
68
rules:
7-
- apiGroups: ["*"]
8-
resources: ["*"]
9-
verbs: ["get", "list", "watch"]
10-
- nonResourceURLs:
11-
- "/metrics"
12-
verbs:
13-
- get
9+
- apiGroups:
10+
- '*'
11+
resources:
12+
- '*'
13+
verbs:
14+
- get
15+
- list
16+
- watch
17+
- nonResourceURLs:
18+
- /metrics
19+
verbs:
20+
- get
21+
1422
---
1523
apiVersion: v1
1624
kind: ServiceAccount
25+
1726
metadata:
1827
name: prometheus
1928
namespace: prometheus
29+
2030
---
2131
apiVersion: rbac.authorization.k8s.io/v1
2232
kind: ClusterRoleBinding
33+
2334
metadata:
2435
name: prometheus
36+
2537
roleRef:
2638
apiGroup: rbac.authorization.k8s.io
2739
kind: ClusterRole
2840
name: prometheus
41+
2942
subjects:
3043
- kind: ServiceAccount
3144
name: prometheus
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
---
12
apiVersion: v1
23
kind: Service
4+
35
metadata:
46
name: prometheus
57
namespace: prometheus
8+
69
spec:
710
selector:
811
app: prometheus
912
ports:
10-
- port: 9090
11-
targetPort: 9090
13+
- port: 9090
14+
targetPort: 9090

kubernetes/manifests/monitoring/prometheus/volume.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
---
12
kind: PersistentVolumeClaim
23
apiVersion: v1
4+
35
metadata:
46
name: prometheus-storage
57
namespace: prometheus
68
labels:
79
app: prometheus
10+
811
spec:
912
storageClassName: do-block-storage
1013
accessModes:

0 commit comments

Comments
 (0)