From 2f10744ce38ab4fc83a03926519a77f79bb68c43 Mon Sep 17 00:00:00 2001 From: Steven Nunez Date: Tue, 21 Jan 2025 20:02:28 -0500 Subject: [PATCH] Create engineer specific staging environment (#54006) Co-authored-by: Kevin Heis --- .devcontainer/.gh-kustomize-version | 1 + .devcontainer/devcontainer.json | 11 +++- .devcontainer/on-create-command.sh | 1 + .devcontainer/post-create-command.sh | 1 + config/kubernetes/production/README.md | 9 +++ .../production/deployments/webapp.yaml | 50 +++++++--------- .../production/services/webapp.yaml | 15 ++--- .../kubernetes/staging-ashishkeshan/README.md | 9 +++ .../deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-ashishkeshan/services/webapp.yaml | 19 +++++++ .../kubernetes/staging-ebonsignori/README.md | 9 +++ .../deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-ebonsignori/services/webapp.yaml | 19 +++++++ .../kubernetes/staging-hectorsector/README.md | 9 +++ .../deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-hectorsector/services/webapp.yaml | 19 +++++++ config/kubernetes/staging-heiskr/README.md | 9 +++ .../staging-heiskr/deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-heiskr/services/webapp.yaml | 19 +++++++ config/kubernetes/staging-octosteve/README.md | 9 +++ .../staging-octosteve/deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-octosteve/services/webapp.yaml | 19 +++++++ config/kubernetes/staging-rachmari/README.md | 9 +++ .../staging-rachmari/deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-rachmari/services/webapp.yaml | 19 +++++++ .../kubernetes/staging-ronricardo/README.md | 9 +++ .../deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-ronricardo/services/webapp.yaml | 19 +++++++ config/kubernetes/staging-saturn226/README.md | 9 +++ .../staging-saturn226/deployments/webapp.yaml | 51 +++++++++++++++++ .../staging-saturn226/services/webapp.yaml | 19 +++++++ config/kustomize/base/deployments/webapp.yaml | 57 +++++++++++++++++++ config/kustomize/base/kustomization.yaml | 6 ++ config/kustomize/base/services/webapp.yaml | 18 ++++++ .../overlays/production/kustomization.yaml | 20 +++++++ .../staging-ashishkeshan/kustomization.yaml | 14 +++++ .../staging-ebonsignori/kustomization.yaml | 14 +++++ .../staging-hectorsector/kustomization.yaml | 14 +++++ .../staging-heiskr/kustomization.yaml | 14 +++++ .../staging-octosteve/kustomization.yaml | 14 +++++ .../staging-rachmari/kustomization.yaml | 14 +++++ .../staging-ronricardo/kustomization.yaml | 14 +++++ .../staging-saturn226/kustomization.yaml | 14 +++++ 43 files changed, 894 insertions(+), 39 deletions(-) create mode 100644 .devcontainer/.gh-kustomize-version create mode 100755 .devcontainer/on-create-command.sh create mode 100755 .devcontainer/post-create-command.sh create mode 100644 config/kubernetes/production/README.md create mode 100644 config/kubernetes/staging-ashishkeshan/README.md create mode 100644 config/kubernetes/staging-ashishkeshan/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-ashishkeshan/services/webapp.yaml create mode 100644 config/kubernetes/staging-ebonsignori/README.md create mode 100644 config/kubernetes/staging-ebonsignori/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-ebonsignori/services/webapp.yaml create mode 100644 config/kubernetes/staging-hectorsector/README.md create mode 100644 config/kubernetes/staging-hectorsector/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-hectorsector/services/webapp.yaml create mode 100644 config/kubernetes/staging-heiskr/README.md create mode 100644 config/kubernetes/staging-heiskr/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-heiskr/services/webapp.yaml create mode 100644 config/kubernetes/staging-octosteve/README.md create mode 100644 config/kubernetes/staging-octosteve/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-octosteve/services/webapp.yaml create mode 100644 config/kubernetes/staging-rachmari/README.md create mode 100644 config/kubernetes/staging-rachmari/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-rachmari/services/webapp.yaml create mode 100644 config/kubernetes/staging-ronricardo/README.md create mode 100644 config/kubernetes/staging-ronricardo/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-ronricardo/services/webapp.yaml create mode 100644 config/kubernetes/staging-saturn226/README.md create mode 100644 config/kubernetes/staging-saturn226/deployments/webapp.yaml create mode 100644 config/kubernetes/staging-saturn226/services/webapp.yaml create mode 100644 config/kustomize/base/deployments/webapp.yaml create mode 100644 config/kustomize/base/kustomization.yaml create mode 100644 config/kustomize/base/services/webapp.yaml create mode 100644 config/kustomize/overlays/production/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-ashishkeshan/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-ebonsignori/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-hectorsector/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-heiskr/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-octosteve/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-rachmari/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-ronricardo/kustomization.yaml create mode 100644 config/kustomize/overlays/staging-saturn226/kustomization.yaml diff --git a/.devcontainer/.gh-kustomize-version b/.devcontainer/.gh-kustomize-version new file mode 100644 index 0000000000..7afb014ccd --- /dev/null +++ b/.devcontainer/.gh-kustomize-version @@ -0,0 +1 @@ +v3.0.5 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8cf61fa806..fbccf72d8a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,8 @@ // Install features. Type 'feature' in the VS Code command palette for a full list. "features": { - "sshd": "latest" + "ghcr.io/devcontainers/features/sshd:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} }, "customizations": { @@ -43,6 +44,11 @@ "permissions": { "contents": "write" } + }, + "github/gh-kustomize": { + "permissions": { + "contents": "read" + } } } } @@ -57,8 +63,9 @@ } }, + "onCreateCommand": ".devcontainer/on-create-command.sh", // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm ci", + "postCreateCommand": ".devcontainer/post-create-command.sh", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "node", diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh new file mode 100755 index 0000000000..e6a08b6720 --- /dev/null +++ b/.devcontainer/on-create-command.sh @@ -0,0 +1 @@ +gh extension install github/gh-kustomize --pin "$(cat .devcontainer/.gh-kustomize-version)" || true \ No newline at end of file diff --git a/.devcontainer/post-create-command.sh b/.devcontainer/post-create-command.sh new file mode 100755 index 0000000000..385cb3aa69 --- /dev/null +++ b/.devcontainer/post-create-command.sh @@ -0,0 +1 @@ +npm ci diff --git a/config/kubernetes/production/README.md b/config/kubernetes/production/README.md new file mode 100644 index 0000000000..fd3dae3854 --- /dev/null +++ b/config/kubernetes/production/README.md @@ -0,0 +1,9 @@ +# Configuration for `production` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **production** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/production/deployments/webapp.yaml b/config/kubernetes/production/deployments/webapp.yaml index fc0bfb0feb..f5381c7f2b 100644 --- a/config/kubernetes/production/deployments/webapp.yaml +++ b/config/kubernetes/production/deployments/webapp.yaml @@ -1,3 +1,4 @@ +# This file was generated with Kustomize. Please do not edit manually. apiVersion: apps/v1 kind: Deployment metadata: @@ -9,49 +10,42 @@ spec: app: webapp template: metadata: - labels: - app: webapp annotations: - # Our internal logs aren't structured so we use logfmt_sloppy to just log stdout and error - # See https://thehub.github.com/epd/engineering/dev-practicals/observability/logging/ for more details fluentbit.io/parser: logfmt_sloppy observability.github.com/splunk_index: docs-internal + labels: + app: webapp spec: - dnsPolicy: Default containers: - - name: webapp - image: docs-internal - resources: - requests: - cpu: 8000m - memory: 10Gi - limits: - cpu: 16000m - memory: 14Gi - ports: - - name: http - containerPort: 4000 - protocol: TCP - envFrom: + - envFrom: - secretRef: name: vault-secrets - configMapRef: name: kube-cluster-metadata - # application-config is crated at deploy time from - # configuration set in config/moda/configuration/*/env.yaml - configMapRef: name: application-config - # Zero-downtime deploys - # https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook - # https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + image: docs-internal lifecycle: preStop: exec: - command: ['sleep', '5'] + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP readinessProbe: - initialDelaySeconds: 5 httpGet: - # WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started. - # See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes path: /healthz port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/production/services/webapp.yaml b/config/kubernetes/production/services/webapp.yaml index 4c96ca5be8..8084da5107 100644 --- a/config/kubernetes/production/services/webapp.yaml +++ b/config/kubernetes/production/services/webapp.yaml @@ -1,17 +1,14 @@ +# This file was generated with Kustomize. Please do not edit manually. apiVersion: v1 kind: Service metadata: - name: webapp + annotations: + moda.github.net/dns-registration-enabled: 'false' + moda.github.net/domain-name: docs.internal.github.com + moda.github.net/load-balancer-type: public-external-http labels: service: webapp - annotations: - moda.github.net/domain-name: 'docs-internal.github.com' - moda.github.net/dns-registration-enabled: 'false' - moda.github.net/load-balancer-type: - public-external-http - # 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' - # ipv6 addresses not included - # curl -i "https://api.fastly.com/public-ip-list" + name: webapp spec: ports: - name: http diff --git a/config/kubernetes/staging-ashishkeshan/README.md b/config/kubernetes/staging-ashishkeshan/README.md new file mode 100644 index 0000000000..8eb202570e --- /dev/null +++ b/config/kubernetes/staging-ashishkeshan/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-ashishkeshan` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-ashishkeshan** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-ashishkeshan/deployments/webapp.yaml b/config/kubernetes/staging-ashishkeshan/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-ashishkeshan/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-ashishkeshan/services/webapp.yaml b/config/kubernetes/staging-ashishkeshan/services/webapp.yaml new file mode 100644 index 0000000000..e3984e3be0 --- /dev/null +++ b/config/kubernetes/staging-ashishkeshan/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-ashishkeshan.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-ebonsignori/README.md b/config/kubernetes/staging-ebonsignori/README.md new file mode 100644 index 0000000000..c008192a40 --- /dev/null +++ b/config/kubernetes/staging-ebonsignori/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-ebonsignori` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-ebonsignori** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-ebonsignori/deployments/webapp.yaml b/config/kubernetes/staging-ebonsignori/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-ebonsignori/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-ebonsignori/services/webapp.yaml b/config/kubernetes/staging-ebonsignori/services/webapp.yaml new file mode 100644 index 0000000000..953545c031 --- /dev/null +++ b/config/kubernetes/staging-ebonsignori/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-ebonsignori.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-hectorsector/README.md b/config/kubernetes/staging-hectorsector/README.md new file mode 100644 index 0000000000..cb18061b15 --- /dev/null +++ b/config/kubernetes/staging-hectorsector/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-hectorsector` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-hectorsector** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-hectorsector/deployments/webapp.yaml b/config/kubernetes/staging-hectorsector/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-hectorsector/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-hectorsector/services/webapp.yaml b/config/kubernetes/staging-hectorsector/services/webapp.yaml new file mode 100644 index 0000000000..9ab47d88a5 --- /dev/null +++ b/config/kubernetes/staging-hectorsector/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-hectorsector.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-heiskr/README.md b/config/kubernetes/staging-heiskr/README.md new file mode 100644 index 0000000000..fa8a5e4e18 --- /dev/null +++ b/config/kubernetes/staging-heiskr/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-heiskr` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-heiskr** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-heiskr/deployments/webapp.yaml b/config/kubernetes/staging-heiskr/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-heiskr/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-heiskr/services/webapp.yaml b/config/kubernetes/staging-heiskr/services/webapp.yaml new file mode 100644 index 0000000000..18bc01b633 --- /dev/null +++ b/config/kubernetes/staging-heiskr/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-heiskr.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-octosteve/README.md b/config/kubernetes/staging-octosteve/README.md new file mode 100644 index 0000000000..7b5ff0808e --- /dev/null +++ b/config/kubernetes/staging-octosteve/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-octosteve` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-octosteve** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-octosteve/deployments/webapp.yaml b/config/kubernetes/staging-octosteve/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-octosteve/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-octosteve/services/webapp.yaml b/config/kubernetes/staging-octosteve/services/webapp.yaml new file mode 100644 index 0000000000..def0d2aaae --- /dev/null +++ b/config/kubernetes/staging-octosteve/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-octosteve.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-rachmari/README.md b/config/kubernetes/staging-rachmari/README.md new file mode 100644 index 0000000000..12709c14ae --- /dev/null +++ b/config/kubernetes/staging-rachmari/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-rachmari` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-rachmari** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-rachmari/deployments/webapp.yaml b/config/kubernetes/staging-rachmari/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-rachmari/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-rachmari/services/webapp.yaml b/config/kubernetes/staging-rachmari/services/webapp.yaml new file mode 100644 index 0000000000..9f2b78e24e --- /dev/null +++ b/config/kubernetes/staging-rachmari/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-rachmari.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-ronricardo/README.md b/config/kubernetes/staging-ronricardo/README.md new file mode 100644 index 0000000000..cd0a9cb700 --- /dev/null +++ b/config/kubernetes/staging-ronricardo/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-ronricardo` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-ronricardo** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-ronricardo/deployments/webapp.yaml b/config/kubernetes/staging-ronricardo/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-ronricardo/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-ronricardo/services/webapp.yaml b/config/kubernetes/staging-ronricardo/services/webapp.yaml new file mode 100644 index 0000000000..817000937c --- /dev/null +++ b/config/kubernetes/staging-ronricardo/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-ronricardo.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kubernetes/staging-saturn226/README.md b/config/kubernetes/staging-saturn226/README.md new file mode 100644 index 0000000000..33665743c3 --- /dev/null +++ b/config/kubernetes/staging-saturn226/README.md @@ -0,0 +1,9 @@ +# Configuration for `staging-saturn226` environment + +The configuration in this directory was autogenerated with Kustomize. + +It contains the configuration for the **staging-saturn226** environment. + +Please avoid editing the files in this directory directly, as they will be overwritten by the next generation. + +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/). diff --git a/config/kubernetes/staging-saturn226/deployments/webapp.yaml b/config/kubernetes/staging-saturn226/deployments/webapp.yaml new file mode 100644 index 0000000000..f5381c7f2b --- /dev/null +++ b/config/kubernetes/staging-saturn226/deployments/webapp.yaml @@ -0,0 +1,51 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + annotations: + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + labels: + app: webapp + spec: + containers: + - envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + - configMapRef: + name: application-config + image: docs-internal + lifecycle: + preStop: + exec: + command: + - sleep + - '5' + name: webapp + ports: + - containerPort: 4000 + name: http + protocol: TCP + readinessProbe: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 5 + resources: + limits: + cpu: 16000m + memory: 14Gi + requests: + cpu: 8000m + memory: 10Gi + dnsPolicy: Default diff --git a/config/kubernetes/staging-saturn226/services/webapp.yaml b/config/kubernetes/staging-saturn226/services/webapp.yaml new file mode 100644 index 0000000000..e5e9952bb3 --- /dev/null +++ b/config/kubernetes/staging-saturn226/services/webapp.yaml @@ -0,0 +1,19 @@ +# This file was generated with Kustomize. Please do not edit manually. +apiVersion: v1 +kind: Service +metadata: + annotations: + moda.github.net/domain-name: docs-staging-saturn226.service.%region%.github.net + moda.github.net/load-balancer-type: internal-http + labels: + service: webapp + name: webapp +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kustomize/base/deployments/webapp.yaml b/config/kustomize/base/deployments/webapp.yaml new file mode 100644 index 0000000000..fc0bfb0feb --- /dev/null +++ b/config/kustomize/base/deployments/webapp.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + replicas: 2 + selector: + matchLabels: + app: webapp + template: + metadata: + labels: + app: webapp + annotations: + # Our internal logs aren't structured so we use logfmt_sloppy to just log stdout and error + # See https://thehub.github.com/epd/engineering/dev-practicals/observability/logging/ for more details + fluentbit.io/parser: logfmt_sloppy + observability.github.com/splunk_index: docs-internal + spec: + dnsPolicy: Default + containers: + - name: webapp + image: docs-internal + resources: + requests: + cpu: 8000m + memory: 10Gi + limits: + cpu: 16000m + memory: 14Gi + ports: + - name: http + containerPort: 4000 + protocol: TCP + envFrom: + - secretRef: + name: vault-secrets + - configMapRef: + name: kube-cluster-metadata + # application-config is crated at deploy time from + # configuration set in config/moda/configuration/*/env.yaml + - configMapRef: + name: application-config + # Zero-downtime deploys + # https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook + # https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + lifecycle: + preStop: + exec: + command: ['sleep', '5'] + readinessProbe: + initialDelaySeconds: 5 + httpGet: + # WARNING: This should be updated to a meaningful endpoint for your application which will return a 200 once the app is fully started. + # See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes + path: /healthz + port: http diff --git a/config/kustomize/base/kustomization.yaml b/config/kustomize/base/kustomization.yaml new file mode 100644 index 0000000000..457850241e --- /dev/null +++ b/config/kustomize/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployments/webapp.yaml + - services/webapp.yaml diff --git a/config/kustomize/base/services/webapp.yaml b/config/kustomize/base/services/webapp.yaml new file mode 100644 index 0000000000..47e40445f2 --- /dev/null +++ b/config/kustomize/base/services/webapp.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: webapp + labels: + service: webapp + annotations: + moda.github.net/domain-name: 'docs-staging-default.service.%region%.github.net' + moda.github.net/load-balancer-type: 'internal-http' +spec: + ports: + - name: http + port: 4000 + protocol: TCP + targetPort: http + selector: + app: webapp + type: LoadBalancer diff --git a/config/kustomize/overlays/production/kustomization.yaml b/config/kustomize/overlays/production/kustomization.yaml new file mode 100644 index 0000000000..916847a55c --- /dev/null +++ b/config/kustomize/overlays/production/kustomization.yaml @@ -0,0 +1,20 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs.internal.github.com' + - op: add + path: /metadata/annotations/moda.github.net~1dns-registration-enabled + value: 'false' + - op: add + path: /metadata/annotations/moda.github.net~1load-balancer-type + value: 'public-external-http' diff --git a/config/kustomize/overlays/staging-ashishkeshan/kustomization.yaml b/config/kustomize/overlays/staging-ashishkeshan/kustomization.yaml new file mode 100644 index 0000000000..e2fe8eb913 --- /dev/null +++ b/config/kustomize/overlays/staging-ashishkeshan/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-ashishkeshan.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-ebonsignori/kustomization.yaml b/config/kustomize/overlays/staging-ebonsignori/kustomization.yaml new file mode 100644 index 0000000000..8d375e87bf --- /dev/null +++ b/config/kustomize/overlays/staging-ebonsignori/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-ebonsignori.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-hectorsector/kustomization.yaml b/config/kustomize/overlays/staging-hectorsector/kustomization.yaml new file mode 100644 index 0000000000..ad3265d0d1 --- /dev/null +++ b/config/kustomize/overlays/staging-hectorsector/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-hectorsector.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-heiskr/kustomization.yaml b/config/kustomize/overlays/staging-heiskr/kustomization.yaml new file mode 100644 index 0000000000..2e409652e0 --- /dev/null +++ b/config/kustomize/overlays/staging-heiskr/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-heiskr.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-octosteve/kustomization.yaml b/config/kustomize/overlays/staging-octosteve/kustomization.yaml new file mode 100644 index 0000000000..b2bbffb418 --- /dev/null +++ b/config/kustomize/overlays/staging-octosteve/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-octosteve.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-rachmari/kustomization.yaml b/config/kustomize/overlays/staging-rachmari/kustomization.yaml new file mode 100644 index 0000000000..e3c8a4f613 --- /dev/null +++ b/config/kustomize/overlays/staging-rachmari/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-rachmari.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-ronricardo/kustomization.yaml b/config/kustomize/overlays/staging-ronricardo/kustomization.yaml new file mode 100644 index 0000000000..1e7817b969 --- /dev/null +++ b/config/kustomize/overlays/staging-ronricardo/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-ronricardo.service.%region%.github.net' diff --git a/config/kustomize/overlays/staging-saturn226/kustomization.yaml b/config/kustomize/overlays/staging-saturn226/kustomization.yaml new file mode 100644 index 0000000000..92ec75ef91 --- /dev/null +++ b/config/kustomize/overlays/staging-saturn226/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Service + name: webapp + patch: | + - op: add + path: /metadata/annotations/moda.github.net~1domain-name + value: 'docs-staging-saturn226.service.%region%.github.net'