Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 3eb3cd0

Browse files
author
Jason Schmidt
authored
Project Reorganization (#89)
* Project Reorganization (#79) * chore: move files to new locations and dir structure * fix: adjust setupvenv for new directory structure * Removed submodule pulumi/aws/sirius/src * chore: remove submodule to move it * Added submodule pulumi/python/kubernetes/applications/sirius/src * chore: cleaning up misc files * chore: update paths for reorganization * fix: bug with how pulumi handles node group options #72 * fix: make paths work with new directory structure * chore: update dependencies * fix: make gh action work with new docker location * fix: changes to GH actions * fix: adjust to work with kubeconfig abstraction * feat: adding in kubeconfig file deployment * fix: updated start/stop scripts for aws/kubeconfig * feat: changes to extend helm timeout and integrate new layout * fix: update chart versions for all helm deployments * fix: upgrade to 2.0.2 IC version * chore: bump requirements * fix: re-enable the abort on error for destroy scripts * feat: created standard start/destroy scripts * fix: downgrade cert manager chart to fix failures with observability * fix: updates to start scripts to fix bugs * fix: remove errant comma from chart version * fix: change where we pull the fqdn from for sirius app * fix: updated bash start/destroy scripts * feat: script to check capabilities * fix: cleanup unused code in module * feat: script to test the installation capabilities for MARA * fix: update helper functions and code * fix: update to keep config dir for tools * fix: add path to extras shell script * fix: change file test for JWT to check size * fix: cleaning up hostname management * fix: change pulumi check to work * chore: bump requirement versions * fix: downgrade pyaml * chore: rename eks vars to k8 for consistency and clarity * chore: refactor out vpc pulumi from mainline logic into sep directory * fix: manage fqdn with kubeconfig files * fix: add script dir to extras install * feat: script updates and cert manager updates * fix: remove introduced error from otel mainline * fix: bugfix on config dir name * fix: removed redundant set of fqdn * chore: bump otel operator version * feat: tune replicas for logstore * feat: update documentation and configs * chore: general cleanup * feat: begin addition of directory level docs * feat: README updates * feat: add configurable timeout to helm operations * fix: updates to fossa for path changes, gitignore * fix: workaround for #72 * feat: updated comments to better reflect the logic * fix: adjust workflow for AWS * fix: update scripts with new logic and tag issues * fix: code cleanup * fix: testing GH actions * fix: testing GH actions * feat: remove centos idockerfile and adjust docker builds * chore: testing * chore: testing workflows * chore: workflows * chore: dep bump * chore: adjust requirements * chore: add python version file * feat: update getting started guide * chore: requirements * fix: change tests to use runner * fix: gitkeep to hold the manifests directory in place * chore: debugging actions * chore: debugging actions * chore: debugging actions * chore: debugging actions * chore: debugging actions * chore: debugging actions * chore: debugging actions * feat: documentation update * fix: config value timeout is an int, we were pulling it as a string (#88) * fix: config value timeout is an int, we were pulling it as a string * feat: creation of additional docs and updates
1 parent fd4d25c commit 3eb3cd0

File tree

127 files changed

+8204
-784
lines changed

Some content is hidden

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

127 files changed

+8204
-784
lines changed

.fossa.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ cli:
55
project: [email protected]:nginxinc/kic-reference-architectures.git
66
analyze:
77
modules:
8-
- name: pulumi/aws
8+
- name: pulumi/python
99
type: pip
10-
path: pulumi/aws
11-
target: pulumi/aws
10+
path: pulumi/python
11+
target: pulumi/python
1212
options:
1313
strategy: pip
14-
requirements: pulumi/aws/requirements.txt
14+
requirements: config/pulumi/requirements.txt

.github/workflows/pulumi-aws-container-tests.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,5 @@ jobs:
1212
- uses: actions/checkout@v2
1313

1414
- name: Build and Test Debian Image
15-
working-directory: pulumi/aws
16-
run: bash build_dev_docker_image.sh debian
17-
18-
centos-container-tests:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v2
22-
23-
- name: Build and Test CentOS Image
24-
working-directory: pulumi/aws
25-
run: bash build_dev_docker_image.sh centos
15+
working-directory:
16+
run: bash docker/build_dev_docker_image.sh debian

.github/workflows/pulumi-aws-tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ jobs:
1313
- uses: syphar/restore-virtualenv@v1
1414
id: pulumi-aws-tests-cache-virtualenv
1515
with:
16-
requirement_files: pulumi/aws/requirements.txt
16+
requirement_files: config/requirements.txt
1717

1818
- uses: syphar/restore-pip-download-cache@v1
1919
if: steps.pulumi-aws-tests-cache-virtualenv.outputs.cache-hit != 'true'
2020

2121
- run: ./setup_venv.sh
22-
working-directory: pulumi/aws
22+
working-directory: bin
2323

2424
- name: Test
25-
working-directory: pulumi/aws
26-
run: python3 test.py
25+
working-directory: bin
26+
run: ./test_runner.sh "/home/runner/work/kic-reference-architectures/kic-reference-architectures"
2727

2828
macos-tests:
2929
runs-on: macos-latest
@@ -33,14 +33,14 @@ jobs:
3333
- uses: syphar/restore-virtualenv@v1
3434
id: pulumi-aws-tests-cache-virtualenv
3535
with:
36-
requirement_files: pulumi/aws/requirements.txt
36+
requirement_files: config/requirements.txt
3737

3838
- uses: syphar/restore-pip-download-cache@v1
3939
if: steps.pulumi-aws-tests-cache-virtualenv.outputs.cache-hit != 'true'
4040

4141
- run: ./setup_venv.sh
42-
working-directory: pulumi/aws
42+
working-directory: bin
4343

4444
- name: Test
45-
working-directory: pulumi/aws
46-
run: python3 test.py
45+
working-directory: bin
46+
run: ./test_runner.sh "/Users/runner/work/kic-reference-architectures/kic-reference-architectures"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,7 @@ override.tf.json
261261
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm+all,terraform
262262

263263
*.pyc
264+
!/extras/jwt.token
265+
/pulumi/python/tools/common/config/*.yaml
266+
/pulumi/python/tools/common/config/environment
267+
!/pulumi/python/kubernetes/nginx/ingress-controller-repo-only/manifests/regcred.yaml

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "pulumi/aws/sirius/src"]
2-
path = pulumi/aws/sirius/src
3-
url = https://github.com/nginxinc/bank-of-sirius.git
1+
[submodule "pulumi/python/kubernetes/applications/sirius/src"]
2+
path = pulumi/python/kubernetes/applications/sirius/src
3+
url = https://github.com/nginxinc/bank-of-sirius.git

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,27 @@
22

33
# NGINX Modern Reference Architectures
44

5-
This repository has the basics for a common way to deploy and manage a modern app. Over time we'll be building more
5+
This repository has the basics for a common way to deploy and manage a modern app. Over time we'll be building more
66
example architectures using different deployment models and options including other clouds, and you’ll be able to find
77
those from here.
88

9+
## Nomenclature
10+
11+
Internally, we refer to this project as MARA for Modern Application Reference Architecture. The current repository name
12+
reflects the humble origins of this project, as it was started for the purpose of allowing users to build custom
13+
versions of the NGINX Ingress Controller. This went so well we decided to expand it out to the project you are now
14+
viewing.
15+
916
## Modern App Architectures
17+
1018
We define modern app architectures as those driven by four characteristics: *scalability*, *portability*, *resiliency*,
1119
and *agility*. While of course there are many different aspects of a modern architecture, these are fundamental.
1220

1321
This diagram is an example of what we mean by a modern app architecture:
14-
![Modern Apps Architecture Example Diagram](DIAG-NGINX-ModernAppsRefArch-04-web-1024x776.svg)
22+
![Modern Apps Architecture Example Diagram](./docs/DIAG-NGINX-ModernAppsRefArch-04-web-1024x776.svg)
1523

1624
To satisfy the four key characteristics, many modern app architectures employ:
25+
1726
* platform agnosticism,
1827
* prioritize OSS,
1928
* everything defined by Code,
@@ -22,40 +31,44 @@ To satisfy the four key characteristics, many modern app architectures employ:
2231
* built on containers, and
2332
* distributed storage.
2433

25-
2634
## What's being built
27-
To see details on the current state of this project, please see the
28-
[readme](https://github.com/nginxinc/kic-reference-architectures/tree/master/pulumi/aws), as this project is under
29-
constant development.
35+
36+
To see details on the current state of this project, please see the
37+
[readme](./pulumi/python/README.md) in the [`pulumi/python`](./pulumi/python) subdirectory. This project is under active
38+
development, and the current work is using [Pulumi](https://www.pulumi.com/) with Python. Additionally, please see
39+
[Status and Issues](./docs/status-and-issues.md) for the current state of the project including build status and known
40+
issues.
3041

3142
This project was started to provide a complete, stealable, easy to deploy, and standalone example of how a modern app
32-
architecture can be built. It was driven by the need to be flexible and not require a long list of dependencies to get
33-
started. It needs to provide examples of tooling used to build this sort of architecture in the real world. Most
34-
importantly, it needs to work. Hopefully this provides a ‘jumping off’ point for someone to build their own infrastructure.
43+
architecture can be built. It was driven by the need to be flexible and not require a long list of dependencies to get
44+
started. It needs to provide examples of tooling used to build this sort of architecture in the real world. Most
45+
importantly, it needs to work. Hopefully this provides a ‘jumping off’ point for someone to build their own
46+
infrastructure.
3547

36-
Subdirectories contained within the root directory separate reference architectures by infrastructure deployment tooling.
48+
Subdirectories contained within the root directory separate reference architectures by infrastructure deployment tooling
49+
with additional subdirectories as needed. For example, Pulumi allows the use of multiple languages for deployment. As we
50+
have decided to use Python in our first build, there is a `python` subdirectory under the `pulumi` directory.
3751

3852
## Deployment Tools
3953

4054
### Pulumi
4155

42-
[Pulumi](https://www.pulumi.com/) is an infrastructure as code tool that
43-
allows you to write code (node, Python, Go, etc) that defines cloud
44-
infrastructure. Within the [`pulumi`](./pulumi) folder are examples for
45-
building and deploying KIC on different cloud environments.
56+
[Pulumi](https://www.pulumi.com/) is an infrastructure as code tool that allows you to write code (node, Python, Go,
57+
etc) that defines cloud infrastructure. Within the [`pulumi`](./pulumi) folder are examples of the pulumi being used to
58+
stand up MARA.
4659

4760
## Contribution
4861

4962
We welcome PRs and issues!
5063

51-
Please refer to the [Contributing Guidelines](CONTRIBUTING.md) when doing a
52-
pull request.
64+
Please refer to the [Contributing Guidelines](CONTRIBUTING.md) when doing a pull request.
5365

5466
## License
5567

5668
All code in this repository is licensed under the
5769
[Apache License v2 license](./LICENSE).
5870

59-
Open source license notices for all projects in this repository can be found [here](https://app.fossa.com/reports/92595e16-c0b8-4c68-8c76-59696b6ac219).
71+
Open source license notices for all projects in this repository can be
72+
found [here](https://app.fossa.com/reports/92595e16-c0b8-4c68-8c76-59696b6ac219).
6073

6174
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git.svg?type=large)](https://app.fossa.com/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git?ref=badge_large)

bin/destroy.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit # abort on nonzero exit status
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
6+
7+
# Don't pollute console output with upgrade notifications
8+
export PULUMI_SKIP_UPDATE_CHECK=true
9+
# Run Pulumi non-interactively
10+
export PULUMI_SKIP_CONFIRMATIONS=true
11+
12+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
13+
14+
if ! command -v pulumi >/dev/null; then
15+
if [ -x "${script_dir}/venv/bin/pulumi" ]; then
16+
echo "Adding to [${script_dir}/venv/bin] to PATH"
17+
export PATH="${script_dir}/venv/bin:$PATH"
18+
fi
19+
fi
20+
21+
if ! command -v pulumi >/dev/null; then
22+
echo >&2 "Pulumi must be installed to continue"
23+
exit 1
24+
fi
25+
26+
if ! command -v python3 >/dev/null; then
27+
echo >&2 "Python 3 must be installed to continue"
28+
exit 1
29+
fi
30+
31+
# Check to see if the user is logged into Pulumi
32+
if ! pulumi whoami --non-interactive >/dev/null 2>&1; then
33+
pulumi login
34+
35+
if ! pulumi whoami --non-interactive >/dev/null 2>&1; then
36+
echo >&2 "Unable to login to Pulumi - exiting"
37+
exit 2
38+
fi
39+
fi
40+
41+
echo " "
42+
echo "Notice! This shell script will read the config/environment file to determine which pulumi stack to destroy."
43+
echo "Based on the type of stack it will either run the ./bin/destroy_kube.sh or the ./bin/destroy_aws.sh script."
44+
echo "If this is not what you want to do, please abort the script by typing ctrl-c and running the appropriate "
45+
echo "script manually."
46+
echo " "
47+
48+
# Sleep so we are seen...
49+
sleep 5
50+
51+
source "${script_dir}/../config/pulumi/environment"
52+
echo "Configuring all Pulumi projects to use the stack: ${PULUMI_STACK}"
53+
54+
#
55+
# Determine what destroy script we need to run
56+
#
57+
if pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config>/dev/null 2>&1; then
58+
INFRA="$(pulumi config get kubernetes:infra_type -C ${script_dir}/../pulumi/python/config)"
59+
if [ $INFRA == 'AWS' ]; then
60+
echo "Destroying an AWS based stack; if this is not right please type ctrl-c to abort this script."
61+
sleep 5
62+
${script_dir}/destroy_aws.sh
63+
exit 0
64+
elif [ $INFRA == 'kubeconfig' ]; then
65+
echo "Destroying a kubeconfig based stack; if this is not right please type ctrl-c to abort this script."
66+
sleep 5
67+
${script_dir}/destroy_kube.sh
68+
exit 0
69+
else
70+
print "No infrastructure set in config file; aborting!"
71+
exit 1
72+
fi
73+
else
74+
print "No infrastructure set in config file; aborting!"
75+
exit 2
76+
fi

0 commit comments

Comments
 (0)