-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.transpire.py
More file actions
51 lines (40 loc) · 1023 Bytes
/
.transpire.py
File metadata and controls
51 lines (40 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from pathlib import Path
from transpire.resources import Deployment, Ingress, Service, Secret
from transpire.types import Image
from transpire.utils import get_image_tag
name = "ocfdocs"
def objects():
# Secrets, added through vault
sec = Secret(
name=name,
string_data={
"OUTLINE_API_KEY": "",
},
)
# Deployment
dep = Deployment(
name=name,
image=get_image_tag("ocfdocs"),
ports=[15000],
)
# Export secrets to environment
dep.pod_spec().with_secret_env(name)
# Service
svc = Service(
name=name,
selector=dep.get_selector(),
port_on_pod=15000,
port_on_svc=80,
)
# Ingress
ing = Ingress(
service_name=name,
host="mkdocs.ocf.berkeley.edu",
service_port=80,
)
yield dep.build()
yield svc.build()
yield ing.build()
yield sec.build()
def images():
yield Image(name="ocfdocs", path=Path("/"), registry="ghcr")