Skip to content

Commit 8a97a71

Browse files
author
iru
committed
chore(docs): add diagram to single-k8s
1 parent 89e79d1 commit 8a97a71

File tree

5 files changed

+81
-6
lines changed

5 files changed

+81
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ For other Cloud providers check: [GCP](https://github.com/sysdiglabs/terraform-g
1919

2020
There are several ways to deploy this in you AWS infrastructure:
2121

22-
### Single-Account
22+
### - Single-Account
2323

2424
Sysdig workload will be deployed in the same account where user's resources will be watched.<br/>
2525
More info in [`./examples/single-account`](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/tree/master/examples/single-account)
2626

2727
![single-account diagram](https://raw.githubusercontent.com/sysdiglabs/terraform-aws-secure-for-cloud/7d142829a701ce78f13691a4af4be373625e7ee2/examples/single-account/diagram-single.png)
2828

2929

30-
### Single-Account with a pre-existing Kubernetes Cluster
30+
### - Single-Account with a pre-existing Kubernetes Cluster
3131

3232
If you already own a Kubernetes Cluster on AWS, you can use it to deploy Sysdig Secure for Cloud, instead of default ECS cluster.
3333

3434
More info in [`./examples/single-account-k8s`](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/tree/master/examples/single-account-k8s)
3535

36-
### Organizational
36+
### - Organizational
3737

3838
Using an organizational configuration Cloudtrail.
3939
More info in [`./examples/organizational`](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/tree/master/examples/organizational)
4040

4141
![organizational diagram](https://raw.githubusercontent.com/sysdiglabs/terraform-aws-secure-for-cloud/5b7cf5e8028b3177536c9c847020ad6319342b44/examples/organizational/diagram-org.png)
4242

43-
### Self-Baked
43+
### - Self-Baked
4444

4545
If no [examples](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/tree/master/examples) fit your use-case, be free to call desired modules directly.
4646

examples/single-account-k8s/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sysdig Secure for Cloud in AWS :: Single-Account on Kubernetes Cluster
1+
# Sysdig Secure for Cloud in AWS <br/>:: Single-Account on Kubernetes Cluster
22

33
Deploy Sysdig Secure for Cloud in a provided existing Kubernetes Cluster.
44

@@ -10,6 +10,8 @@ Deploy Sysdig Secure for Cloud in a provided existing Kubernetes Cluster.
1010

1111
All the required resources and workloads will be run under the same AWS account.
1212

13+
![single-account-k8s diagram](https://raw.githubusercontent.com/sysdiglabs/terraform-aws-secure-for-cloud/master/examples/single-account-k8s/diagram.png)
14+
1315
## Prerequisites
1416

1517
Minimum requirements:
165 KB
Loading
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# diagrams as code vía https://diagrams.mingrammer.com
2+
from diagrams import Cluster, Diagram, Edge, Node
3+
from diagrams.aws.general import General
4+
from diagrams.aws.compute import EKS, ECR
5+
from diagrams.aws.devtools import Codebuild
6+
from diagrams.aws.integration import SNS, SQS
7+
from diagrams.aws.management import Cloudtrail
8+
from diagrams.aws.security import IAM, IAMRole
9+
from diagrams.aws.storage import S3
10+
from diagrams.custom import Custom
11+
12+
from diagrams.k8s.group import Namespace
13+
from diagrams.k8s.compute import Deployment
14+
15+
diagram_attr = {
16+
"pad":"0.25"
17+
}
18+
19+
role_attr = {
20+
"imagescale":"false",
21+
"height":"1.5",
22+
"width":"3",
23+
"fontsize":"9",
24+
}
25+
26+
color_event="firebrick"
27+
color_scanning = "dark-green"
28+
color_permission="red"
29+
color_creates="darkblue"
30+
color_non_important="gray"
31+
color_sysdig="lightblue"
32+
33+
34+
35+
with Diagram("Sysdig Secure for Cloud{}(single-account-k8s)".format("\n"), graph_attr=diagram_attr, filename="diagram", show=True, direction="RL"):
36+
37+
with Cluster("AWS account (target)"):
38+
39+
with Cluster("other resources", graph_attr={"bgcolor":"lightblue"}):
40+
account_resources = [General("resource-1..n")]
41+
ecr = ECR("container-registry")
42+
43+
with Cluster("sysdig-secure-for-cloud resources"):
44+
management_credentials = IAM("credentials", fontsize="10")
45+
46+
cloudtrail = Cloudtrail("cloudtrail", shape="plaintext")
47+
sns = SNS("sns")
48+
sqs = SQS("sqs")
49+
cloudtrail >> Edge(color=color_event) >> sns << sqs
50+
51+
with Cluster(""):
52+
eks = EKS("EKS\n(pre-existing)")
53+
with Cluster("namespace: sfc"):
54+
cc_deployment = Deployment("cloud-connector")
55+
cloud_scanning = Deployment("cloud-scaner")
56+
eks_deployments = [cc_deployment, cloud_scanning]
57+
58+
59+
eks_deployments >> Edge(color=color_sysdig, style="dashed") >> sqs
60+
61+
# scanning
62+
codebuild = Codebuild("Build-project")
63+
cloud_scanning >> codebuild
64+
codebuild >> Edge(color=color_non_important) >> ecr
65+
66+
account_resources >> Edge(color=color_event, style="dashed", label="Events") >> cloudtrail
67+
68+
with Cluster("AWS account (sysdig)"):
69+
sds = Custom("Sysdig Secure", "../../resources/diag-sysdig-icon.png")
70+
71+
eks_deployments >> Edge(color=color_sysdig) >> sds

examples/single-account/diagram-single.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@
5959
sqs = SQS("cloudtrail-sqs")
6060
s3_config = S3("cloud-connector-config")
6161
cloudwatch = Cloudwatch("cloudwatch\n(logs and alarms)")
62-
codebuild = Codebuild("Build-project")
6362

6463
sqs << Edge(color=color_event) << cloud_connector
6564
sqs << Edge(color=color_event) << cloud_scanning
6665
cloud_connector - Edge(color=color_non_important) - s3_config
6766
cloud_connector >> Edge(color=color_non_important) >> cloudwatch
67+
68+
# scanning
69+
codebuild = Codebuild("Build-project")
6870
cloud_scanning >> Edge(color=color_non_important) >> cloudwatch
6971
cloud_scanning >> codebuild
7072
codebuild >> Edge(color=color_non_important) >> ecr

0 commit comments

Comments
 (0)