-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes Support #3
Comments
Could you please show the example code (you want) for the Kubernetes layer? :) |
Looks very ugly and tough, but I wish you could take my thought about this. from diagrams import Cluster, Diagram
from diagrams.k8s import Pod
from diagrams.k8s.apps.v1 import StatefulSet, Deployment, Ingress, Service
from diagrams.k8s.apps.v1.service import NodePort
from diagrams.aws.database import RDS, ElastiCache
from diagrams.aws.network import VPC
from diagrams.aws.integration import SQS
with VPC('Service Network'):
with Cluster('Database Cluster: Main'):
main_db_master = RDS(name='main', type='aurora_mysql')
main_db_master - [RDS(name='replicas')]
with Cluster('Database Cluster: Auth'):
auth_db_master = RDS(name='main', type='aurora_posgresql')
auth_db_master - [RDS(name='replicas')]
couchbase = StatefulSet(name='couchbase')
with Cluster('Redis Cluster: cache'):
cache_redis = [ElastiCache(name='cache_redis', type='redis'), ]
with Cluster('Redis Clsuter: session'):
session_redis = [ElastiCache(name='session_rdis', type='redis'), ]
base_sqs = SQS(name='base')
hard_sqs = SQS(name='hard')
with Deployment('Deployment: api'):
apis = [Pod(name='product1_api', port=3001), ]
apis >> couchbase
apis >> main_db_master
apis >> auth_db_master
apis >> cache_redis
apis >> session_redis
apis >> couchbase
apis - base_sqs
apis - hard_sqs
with Deployment('Deployment: base_worker'):
base_workers = [Pod(name='product1_worker_base'), ]
base_workers >> main_db_master
base_workers >> auth_db_master
base_sqs - base_workers
with Deployment('Deployment: hard_worker'):
hard_workers = [Pod(name='product1_worker_hard'), ]
hard_workers >> main_db_master
hard_workers >> auth_db_master
hard_sqs - hard_workers
# api
ingress = Ingress(name='ingress')
service = Service(name='product1_service', port=3000)
ingress >> service >> NodePort(service_port=3000, target_port=3001) >> apis Also, I think array of instances could be represented as stacked it for scalability: stacked = [Class(), ]
|
Thanks for the ideas. All node classes of However, there are some missing icons of specific resource types such as And this code from diagrams.k8s import Pod
from diagrams.k8s.apps.v1 import StatefulSet, Deployment, Ingress, Service
from diagrams.k8s.apps.v1.service import NodePort should be like this, for keeping the consistency with other providers. from diagrams.k8s.compute import Pod, StatefulSet, Deployment
from diagrams.k8s.network import Ingress, Service
+ Currently,
with VPC():
pass
with Deployment():
pass + Graphviz does not support |
Sounds good to me! |
Yap! Thank you :) |
@jeyraof Diagrams v0.2.0 now supports basic Kubernetes diagrams! Node Types
Examples# k8s resources
from diagrams.k8s.compute import Pod, StatefulSet
from diagrams.k8s.network import Service
from diagrams.k8s.storage import PV, PVC, StorageClass
... |
What a fast are you! |
Do you have a plan to support Kubernetes layer?
I think that resources frequently refered on AWS contains
Ingress
,Deployment
,Service
,StatefulSet
and so on.Thank you.
The text was updated successfully, but these errors were encountered: