Skip to content

Commit 59a384c

Browse files
authored
Merge pull request #46282 from github/repo-sync
Repo sync
2 parents dbd0547 + 3a3bc20 commit 59a384c

34 files changed

Lines changed: 637 additions & 161 deletions

File tree

‎.devcontainer/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Update ARG and FROM together from the Node devcontainer image tags:
22
# https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
33
ARG VARIANT=dev-24-bookworm
4-
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:c39e4aaf0c7c4da594f845aeb98d37510343bff178b320a6f7e9e2e95ca7957e
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:02207aa539c49a8714bd18ba482a05381a42ee4768ea19a39a4c58f2ae6f7644

‎.github/workflows/moda-allowed-ips.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ jobs:
3030
echo "Got a list of Fastly IP addresses: $ips"
3131
3232
echo "Updating the list of allowed IPs in Moda config..."
33-
yq -i ".metadata.annotations[\"moda.github.net/allowed-ips\"] = \"$ips\"" \
33+
# Update the Kustomize source and the generated file together.
34+
# The moda-linter check fails if they don't match.
35+
for file in \
36+
config/kustomize/overlays/production/services/webapp.yaml \
3437
config/kubernetes/production/services/webapp.yaml
38+
do
39+
yq -i ".metadata.annotations[\"moda.github.net/allowed-ips\"] = \"$ips\"" "$file"
40+
done
3541
echo "Updated the list of allowed IPs in Moda config"
3642
3743
echo "Checking if there is a change to make..."
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration for `default` environment
2+
3+
The configuration in this directory was autogenerated with Kustomize.
4+
5+
It contains the configuration for the **default** environment.
6+
7+
Please avoid editing the files in this directory directly, as they will be overwritten by the next generation.
8+
9+
To learn more about how to use [Kustomize](https://kustomize.io/) at GitHub, please visit [Kustomize on The Hub](https://thehub.github.com/epd/engineering/products-and-services/internal/moda/kustomize/).
Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,27 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
4-
name: webapp
55
annotations:
66
moda.github.net/inject-unified-service-tag-env-var: docs-internal
7+
name: webapp
78
spec:
89
replicas: 1
910
selector:
1011
matchLabels:
1112
app: webapp
1213
template:
1314
metadata:
14-
labels:
15-
app: webapp
1615
annotations:
17-
# Use logfmt_sloppy because internal logs write unstructured stdout and stderr.
18-
# https://thehub.github.com/epd/engineering/dev-practicals/observability/logging/
16+
ad.datadoghq.com/tolerate-unready: 'true'
17+
ad.datadoghq.com/webapp.logs: '[{"source":"nodejs","service":"docs-internal","tags":["env:staging"]}]'
1918
fluentbit.io/parser: logfmt_sloppy
2019
observability.github.com/splunk_index: docs-internal
21-
ad.datadoghq.com/webapp.logs: '[{"source":"nodejs","service":"docs-internal","tags":["env:staging"]}]'
22-
ad.datadoghq.com/tolerate-unready: 'true'
20+
labels:
21+
app: webapp
2322
spec:
24-
dnsPolicy: Default
25-
terminationGracePeriodSeconds: 60
2623
containers:
27-
- name: webapp
28-
image: docs-internal
29-
# Retune using 2 weeks of data:
30-
# https://app.datadoghq.com/dashboard/6vx-iun-ghs/moda-resource-recommendations?tpl_var_kube_namespace%5B0%5D=docs-internal-staging-balsam&tpl_var_kube_namespace%5B1%5D=docs-internal-staging-boxwood&tpl_var_kube_namespace%5B2%5D=docs-internal-staging-cedar&tpl_var_kube_namespace%5B3%5D=docs-internal-staging-cypress&tpl_var_kube_namespace%5B4%5D=docs-internal-staging-fir&tpl_var_kube_namespace%5B5%5D=docs-internal-staging-hemlock&tpl_var_kube_namespace%5B6%5D=docs-internal-staging-hinoki&tpl_var_kube_namespace%5B7%5D=docs-internal-staging-holly&tpl_var_kube_namespace%5B8%5D=docs-internal-staging-juniper&tpl_var_kube_namespace%5B9%5D=docs-internal-staging-laurel&tpl_var_kube_namespace%5B10%5D=docs-internal-staging-pine&tpl_var_kube_namespace%5B11%5D=docs-internal-staging-redwood&tpl_var_kube_namespace%5B12%5D=docs-internal-staging-sequoia&tpl_var_kube_namespace%5B13%5D=docs-internal-staging-spruce&tpl_var_kube_namespace%5B14%5D=docs-internal-staging-yew&from_ts=0&to_ts=1209600000&live=true
31-
# Staging is not budget checked.
32-
resources:
33-
requests:
34-
# requests.cpu: 150m idle schedule floor because staging idles near zero.
35-
cpu: 150m
36-
# requests.memory: highest-peak pod p99 (1882Mi) * 1.1 for working-set padding.
37-
memory: 2070Mi
38-
limits:
39-
# limits.cpu: highest warmup peak (1.82 cores) * 3 for startup headroom.
40-
cpu: 5460m
41-
# limits.memory: highest-peak pod max (1882Mi) * 2.
42-
# Over the limit means OOMKill; memory is not compressible.
43-
memory: 3764Mi
44-
ports:
45-
- name: http
46-
containerPort: 4000
47-
protocol: TCP
48-
envFrom:
49-
- secretRef:
50-
name: vault-secrets
51-
- configMapRef:
52-
name: kube-cluster-metadata
53-
# Moda creates application-config from config/moda/configuration/*/env.yaml.
54-
- configMapRef:
55-
name: application-config
56-
env:
24+
- env:
5725
- name: POD_NAME
5826
valueFrom:
5927
fieldRef:
@@ -62,25 +30,46 @@ spec:
6230
valueFrom:
6331
fieldRef:
6432
fieldPath: metadata.namespace
65-
# Sleep before shutdown so Moda drains connections before old pods exit.
66-
# https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook
33+
envFrom:
34+
- secretRef:
35+
name: vault-secrets
36+
- configMapRef:
37+
name: kube-cluster-metadata
38+
- configMapRef:
39+
name: application-config
40+
image: docs-internal
6741
lifecycle:
6842
preStop:
6943
exec:
70-
command: ['sleep', '5']
71-
# See config/kubernetes/production/deployments/webapp.yaml for probe details.
72-
startupProbe:
44+
command:
45+
- sleep
46+
- '5'
47+
name: webapp
48+
ports:
49+
- containerPort: 4000
50+
name: http
51+
protocol: TCP
52+
readinessProbe:
53+
failureThreshold: 5
7354
httpGet:
7455
path: /healthcheck
7556
port: http
76-
initialDelaySeconds: 30
77-
periodSeconds: 5
78-
failureThreshold: 30
57+
periodSeconds: 10
7958
timeoutSeconds: 5
80-
readinessProbe:
59+
resources:
60+
limits:
61+
cpu: 5460m
62+
memory: 3764Mi
63+
requests:
64+
cpu: 150m
65+
memory: 2070Mi
66+
startupProbe:
67+
failureThreshold: 30
8168
httpGet:
8269
path: /healthcheck
8370
port: http
84-
periodSeconds: 10
85-
failureThreshold: 5
71+
initialDelaySeconds: 30
72+
periodSeconds: 5
8673
timeoutSeconds: 5
74+
dnsPolicy: Default
75+
terminationGracePeriodSeconds: 60

‎config/kubernetes/default/services/webapp.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
12
apiVersion: v1
23
kind: Service
34
metadata:
4-
name: webapp
5-
labels:
6-
service: webapp
75
annotations:
8-
moda.github.net/domain-name: 'docs-internal-%environment%.service.%region%.github.net'
9-
# Expose the employee website as an internal HTTP load balancer.
6+
moda.github.net/domain-name: docs-internal-%environment%.service.%region%.github.net
107
moda.github.net/load-balancer-type: internal-http
8+
labels:
9+
service: webapp
10+
name: webapp
1111
spec:
1212
ports:
1313
- name: http
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration for `docs-internal-review-lab` environment
2+
3+
The configuration in this directory was autogenerated with Kustomize.
4+
5+
It contains the configuration for the **docs-internal-review-lab** environment.
6+
7+
Please avoid editing the files in this directory directly, as they will be overwritten by the next generation.
8+
9+
To learn more about how to use [Kustomize](https://kustomize.io/) at GitHub, please visit [Kustomize on The Hub](https://thehub.github.com/epd/engineering/products-and-services/internal/moda/kustomize/).
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
annotations:
6+
moda.github.net/inject-unified-service-tag-env-var: docs-internal
7+
name: webapp
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: webapp
13+
template:
14+
metadata:
15+
annotations:
16+
ad.datadoghq.com/tolerate-unready: 'true'
17+
ad.datadoghq.com/webapp.logs: '[{"source":"nodejs","service":"docs-internal","tags":["env:docs-internal-review-lab"]}]'
18+
fluentbit.io/parser: logfmt_sloppy
19+
observability.github.com/splunk_index: docs-internal
20+
labels:
21+
app: webapp
22+
spec:
23+
containers:
24+
- env:
25+
- name: POD_NAME
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.name
29+
- name: POD_NAMESPACE
30+
valueFrom:
31+
fieldRef:
32+
fieldPath: metadata.namespace
33+
envFrom:
34+
- secretRef:
35+
name: vault-secrets
36+
- configMapRef:
37+
name: kube-cluster-metadata
38+
- configMapRef:
39+
name: application-config
40+
image: docs-internal
41+
lifecycle:
42+
preStop:
43+
exec:
44+
command:
45+
- sleep
46+
- '5'
47+
name: webapp
48+
ports:
49+
- containerPort: 4000
50+
name: http
51+
protocol: TCP
52+
readinessProbe:
53+
failureThreshold: 5
54+
httpGet:
55+
path: /healthcheck
56+
port: http
57+
periodSeconds: 10
58+
timeoutSeconds: 5
59+
resources:
60+
limits:
61+
cpu: 5460m
62+
memory: 3764Mi
63+
requests:
64+
cpu: 150m
65+
memory: 2070Mi
66+
startupProbe:
67+
failureThreshold: 30
68+
httpGet:
69+
path: /healthcheck
70+
port: http
71+
initialDelaySeconds: 30
72+
periodSeconds: 5
73+
timeoutSeconds: 5
74+
dnsPolicy: Default
75+
terminationGracePeriodSeconds: 60
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
annotations:
6+
tailscale.com/http-endpoint: enabled
7+
tailscale.com/proxy-group: ingress-proxies
8+
tailscale.com/tags: tag:proxima-review-lab
9+
name: http
10+
namespace: '%namespace%'
11+
spec:
12+
ingressClassName: tailscale
13+
rules:
14+
- http:
15+
paths:
16+
- backend:
17+
service:
18+
name: router
19+
port:
20+
number: 80
21+
path: /
22+
pathType: Prefix
23+
tls:
24+
- hosts:
25+
- '%namespace%'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
labels:
6+
service: router
7+
name: router
8+
spec:
9+
ports:
10+
- name: http
11+
port: 80
12+
protocol: TCP
13+
targetPort: http
14+
selector:
15+
app: webapp
16+
type: ClusterIP
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration for `production` environment
2+
3+
The configuration in this directory was autogenerated with Kustomize.
4+
5+
It contains the configuration for the **production** environment.
6+
7+
Please avoid editing the files in this directory directly, as they will be overwritten by the next generation.
8+
9+
To learn more about how to use [Kustomize](https://kustomize.io/) at GitHub, please visit [Kustomize on The Hub](https://thehub.github.com/epd/engineering/products-and-services/internal/moda/kustomize/).

0 commit comments

Comments
 (0)