-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
262 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
from diagrams import Diagram, Cluster, Edge | ||
from diagrams.custom import Custom | ||
from diagrams.onprem.security import Vault | ||
from diagrams.onprem.network import Zookeeper | ||
from diagrams.onprem.queue import Kafka | ||
from diagrams.elastic.elasticsearch import Elasticsearch | ||
from diagrams.elastic.elasticsearch import Kibana | ||
from diagrams.elastic.elasticsearch import Logstash | ||
from diagrams.onprem.container import Docker | ||
from diagrams.programming.language import Python | ||
from diagrams.generic.storage import Storage | ||
from diagrams.onprem.database import Mongodb | ||
from diagrams.onprem.database import Influxdb | ||
from diagrams.onprem.monitoring import Grafana | ||
from diagrams.onprem.ci import TC | ||
|
||
|
||
def main(): | ||
graph_attr = { | ||
"fontsize": "45", | ||
'overlap_scaling': '100', | ||
'size': '24!', | ||
'ratio': 'expand' | ||
} | ||
|
||
with Diagram(name='Automation Framework Kubernetes', direction='LR', graph_attr=graph_attr): | ||
with Cluster('Docker Cluster'): | ||
docker = Docker('Docker') | ||
|
||
with Cluster('container1'): | ||
python_container = Python('APIs\nOther Microservices') | ||
|
||
with Cluster('Docker Registry'): | ||
docker_registry_container = Docker('Docker Registry\ntcp:5000') | ||
|
||
with Cluster('Docker Registry Browser'): | ||
docker_registry_browser_container = Python('Docker Registry Browser\ntcp:8088') | ||
|
||
with Cluster('BatFish'): | ||
batfish_container = Custom('BatFish\ntcp:8888\ntcp:9997\ntcp:9996', 'custom_icons/BatFish.png') | ||
|
||
with Cluster('Secrets Managers'): | ||
vault = Vault('HashiCorp Vault\ntcp:8200') | ||
secrets_managers = [ | ||
vault, | ||
] | ||
|
||
with Cluster('Logging and Search'): | ||
with Cluster('ELK Stack'): | ||
elastic_search = Elasticsearch('Elastic Search\ntcp:9200') | ||
kibana = Kibana('Kibana\ntcp:5601') | ||
logstash = Logstash('Logstash\ntcp:5044') | ||
search_log = [ | ||
elastic_search, | ||
kibana, | ||
logstash | ||
] | ||
|
||
with Cluster('Influxdb'): | ||
infulxdb = Influxdb('Influxdb\ntcp:8086') | ||
|
||
with Cluster('Grafana'): | ||
grafana = Grafana('Grafana\ntcp:3000') | ||
|
||
with Cluster('Database'): | ||
with Cluster('Mongo dB'): | ||
mongodb = Mongodb('MongoDb\ntcp:27017') | ||
mongodb_express = Mongodb('MongoDb Express\ntcp:8181') | ||
mongo_group = [ | ||
mongodb, | ||
mongodb_express | ||
] | ||
|
||
with Cluster('CI/CD'): | ||
team_city = TC('TeamCity') | ||
|
||
|
||
python_container - vault | ||
|
||
python_container - logstash | ||
|
||
python_container - infulxdb | ||
|
||
python_container - mongodb | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
version: '3.4' | ||
services: | ||
teamcity-server-instance: | ||
image: jetbrains/teamcity-server:latest | ||
container_name: teamcity-server-instance | ||
ports: | ||
- 8111:8111 | ||
volumes: | ||
- "teamcity-server-datadir-compose:/data/teamcity_server/datadir" | ||
- "teamcity-server-logs-compose:/opt/teamcity/logs" | ||
restart: on-failure | ||
teamcity-agent-1: | ||
build: | ||
context: ../dockerfile | ||
dockerfile: Dockerfile-Python-Agent | ||
image: localhost:32000/teamcity-agent-python:latest | ||
container_name: teamcity-agent-1 | ||
environment: | ||
SERVER_URL: http://10.0.0.102:8111 | ||
volumes: | ||
- "teamcity-agent-1-conf-compose:/data/teamcity_agent/conf" | ||
restart: on-failure | ||
|
||
volumes: | ||
teamcity-server-datadir-compose: | ||
teamcity-server-logs-compose: | ||
teamcity-agent-1-conf-compose: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM jetbrains/teamcity-agent:EAP-linux-sudo | ||
|
||
LABEL version="2021.9.6.001" | ||
LABEL description="TeamCity Python3 agent" | ||
LABEL maintainer="Ben Trachtenberg" | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN sudo apt-get update \ | ||
&& sudo apt-get install -qy \ | ||
python3-pip \ | ||
python3-venv | ||
|
32 changes: 32 additions & 0 deletions
32
k8s/teamcity-latest-lb/teamcity-agent-python-latest-deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- # Version 2021.9.6.001 | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: teamcity-agent-python | ||
labels: | ||
app: teamcity-agent-python | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: teamcity-agent-python | ||
template: | ||
metadata: | ||
labels: | ||
app: teamcity-agent-python | ||
spec: | ||
terminationGracePeriodSeconds: 1 | ||
containers: | ||
- name: teamcity-agent-python | ||
image: localhost:32000/teamcity-agent-python:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: SERVER_URL | ||
value: "http://teamcity-server:8111" | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "500Mi" | ||
cpu: "500m" |
43 changes: 43 additions & 0 deletions
43
k8s/teamcity-latest-lb/teamcity-server-latest-deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- # Version 2021.9.6.001 | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: teamcity-server | ||
labels: | ||
app: teamcity-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: teamcity-server | ||
template: | ||
metadata: | ||
labels: | ||
app: teamcity-server | ||
spec: | ||
terminationGracePeriodSeconds: 1 | ||
containers: | ||
- name: teamcity-server | ||
image: jetbrains/teamcity-server:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8111 | ||
resources: | ||
requests: | ||
memory: "2Gi" | ||
cpu: "500m" | ||
limits: | ||
memory: "4Gi" | ||
cpu: "1" | ||
volumeMounts: | ||
- name: teamcity-server-datadir | ||
mountPath: /data/teamcity_server/datadir | ||
- name: teamcity-server-logs | ||
mountPath: /opt/teamcity/logs | ||
volumes: | ||
- name: teamcity-server-datadir | ||
persistentVolumeClaim: | ||
claimName: teamcity-server-datadir-claim | ||
- name: teamcity-server-logs | ||
persistentVolumeClaim: | ||
claimName: teamcity-server-logs-claim |
13 changes: 13 additions & 0 deletions
13
k8s/teamcity-latest-lb/teamcity-server-latest-service-lb.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: teamcity-server | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: 8111 | ||
targetPort: 8111 | ||
name: teamcity-server-gui | ||
selector: | ||
app: teamcity-server |
12 changes: 12 additions & 0 deletions
12
k8s/teamcity-latest-lb/teamcity-server-latest-volumes-pvc-datadir-claim.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- # Version 2021.9.6.001 | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: teamcity-server-datadir-claim | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
volumeMode: Filesystem | ||
resources: | ||
requests: | ||
storage: 20Gi |
12 changes: 12 additions & 0 deletions
12
k8s/teamcity-latest-lb/teamcity-server-latest-volumes-pvc-logs-claim.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- # Version 2021.9.6.001 | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: teamcity-server-logs-claim | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
volumeMode: Filesystem | ||
resources: | ||
requests: | ||
storage: 20Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ pytest-html~=3.1.1 | |
coverage~=5.5.0 | ||
pylint~=2.8.2 | ||
sphinx~=4.0.0 | ||
diagrams~=0.19.0 | ||
diagrams~=0.20.0 |