Skip to content

Commit 2f10744

Browse files
octosteveheiskr
andauthored
Create engineer specific staging environment (#54006)
Co-authored-by: Kevin Heis <[email protected]>
1 parent 03fa6cc commit 2f10744

File tree

43 files changed

+894
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+894
-39
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v3.0.5

.devcontainer/devcontainer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
// Install features. Type 'feature' in the VS Code command palette for a full list.
1313
"features": {
14-
"sshd": "latest"
14+
"ghcr.io/devcontainers/features/sshd:1": {},
15+
"ghcr.io/devcontainers/features/github-cli:1": {}
1516
},
1617

1718
"customizations": {
@@ -43,6 +44,11 @@
4344
"permissions": {
4445
"contents": "write"
4546
}
47+
},
48+
"github/gh-kustomize": {
49+
"permissions": {
50+
"contents": "read"
51+
}
4652
}
4753
}
4854
}
@@ -57,8 +63,9 @@
5763
}
5864
},
5965

66+
"onCreateCommand": ".devcontainer/on-create-command.sh",
6067
// Use 'postCreateCommand' to run commands after the container is created.
61-
"postCreateCommand": "npm ci",
68+
"postCreateCommand": ".devcontainer/post-create-command.sh",
6269

6370
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
6471
"remoteUser": "node",

.devcontainer/on-create-command.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gh extension install github/gh-kustomize --pin "$(cat .devcontainer/.gh-kustomize-version)" || true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm ci
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/).
Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
@@ -9,49 +10,42 @@ spec:
910
app: webapp
1011
template:
1112
metadata:
12-
labels:
13-
app: webapp
1413
annotations:
15-
# Our internal logs aren't structured so we use logfmt_sloppy to just log stdout and error
16-
# See https://thehub.github.com/epd/engineering/dev-practicals/observability/logging/ for more details
1714
fluentbit.io/parser: logfmt_sloppy
1815
observability.github.com/splunk_index: docs-internal
16+
labels:
17+
app: webapp
1918
spec:
20-
dnsPolicy: Default
2119
containers:
22-
- name: webapp
23-
image: docs-internal
24-
resources:
25-
requests:
26-
cpu: 8000m
27-
memory: 10Gi
28-
limits:
29-
cpu: 16000m
30-
memory: 14Gi
31-
ports:
32-
- name: http
33-
containerPort: 4000
34-
protocol: TCP
35-
envFrom:
20+
- envFrom:
3621
- secretRef:
3722
name: vault-secrets
3823
- configMapRef:
3924
name: kube-cluster-metadata
40-
# application-config is crated at deploy time from
41-
# configuration set in config/moda/configuration/*/env.yaml
4225
- configMapRef:
4326
name: application-config
44-
# Zero-downtime deploys
45-
# https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook
46-
# https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
27+
image: docs-internal
4728
lifecycle:
4829
preStop:
4930
exec:
50-
command: ['sleep', '5']
31+
command:
32+
- sleep
33+
- '5'
34+
name: webapp
35+
ports:
36+
- containerPort: 4000
37+
name: http
38+
protocol: TCP
5139
readinessProbe:
52-
initialDelaySeconds: 5
5340
httpGet:
54-
# WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started.
55-
# See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes
5641
path: /healthz
5742
port: http
43+
initialDelaySeconds: 5
44+
resources:
45+
limits:
46+
cpu: 16000m
47+
memory: 14Gi
48+
requests:
49+
cpu: 8000m
50+
memory: 10Gi
51+
dnsPolicy: Default

config/kubernetes/production/services/webapp.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
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.github.com'
96
moda.github.net/dns-registration-enabled: 'false'
10-
moda.github.net/load-balancer-type:
11-
public-external-http
12-
# moda.github.net/allowed-ips: '23.235.32.0/20,43.249.72.0/22,103.244.50.0/24,103.245.222.0/23,103.245.224.0/24,104.156.80.0/20,140.248.64.0/18,140.248.128.0/17,146.75.0.0/17,151.101.0.0/16,157.52.64.0/18,167.82.0.0/17,167.82.128.0/20,167.82.160.0/20,167.82.224.0/20,172.111.64.0/18,185.31.16.0/22,199.27.72.0/21,199.232.0.0/1'
13-
# ipv6 addresses not included
14-
# curl -i "https://api.fastly.com/public-ip-list"
7+
moda.github.net/domain-name: docs.internal.github.com
8+
moda.github.net/load-balancer-type: public-external-http
9+
labels:
10+
service: webapp
11+
name: webapp
1512
spec:
1613
ports:
1714
- name: http
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration for `staging-ashishkeshan` environment
2+
3+
The configuration in this directory was autogenerated with Kustomize.
4+
5+
It contains the configuration for the **staging-ashishkeshan** 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: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: webapp
6+
spec:
7+
replicas: 2
8+
selector:
9+
matchLabels:
10+
app: webapp
11+
template:
12+
metadata:
13+
annotations:
14+
fluentbit.io/parser: logfmt_sloppy
15+
observability.github.com/splunk_index: docs-internal
16+
labels:
17+
app: webapp
18+
spec:
19+
containers:
20+
- envFrom:
21+
- secretRef:
22+
name: vault-secrets
23+
- configMapRef:
24+
name: kube-cluster-metadata
25+
- configMapRef:
26+
name: application-config
27+
image: docs-internal
28+
lifecycle:
29+
preStop:
30+
exec:
31+
command:
32+
- sleep
33+
- '5'
34+
name: webapp
35+
ports:
36+
- containerPort: 4000
37+
name: http
38+
protocol: TCP
39+
readinessProbe:
40+
httpGet:
41+
path: /healthz
42+
port: http
43+
initialDelaySeconds: 5
44+
resources:
45+
limits:
46+
cpu: 16000m
47+
memory: 14Gi
48+
requests:
49+
cpu: 8000m
50+
memory: 10Gi
51+
dnsPolicy: Default
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file was generated with Kustomize. Please do not edit manually.
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
annotations:
6+
moda.github.net/domain-name: docs-staging-ashishkeshan.service.%region%.github.net
7+
moda.github.net/load-balancer-type: internal-http
8+
labels:
9+
service: webapp
10+
name: webapp
11+
spec:
12+
ports:
13+
- name: http
14+
port: 4000
15+
protocol: TCP
16+
targetPort: http
17+
selector:
18+
app: webapp
19+
type: LoadBalancer

0 commit comments

Comments
 (0)