-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathTiltfile
More file actions
104 lines (92 loc) · 2.55 KB
/
Tiltfile
File metadata and controls
104 lines (92 loc) · 2.55 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
load('ext://cert_manager', 'deploy_cert_manager')
load("ext://restart_process", "docker_build_with_restart")
enable_prometheus=False
deploy_source='kustomize'
secure_clusters = True
image_repo = "ghcr.io/clickhouse/clickhouse-operator"
if not local("kubectl wait --for=condition=Available -n cert-manager deployment/cert-manager", quiet=True, echo_off=True):
deploy_cert_manager(version='v1.19.2')
else:
print("cert-manager is already deployed")
if enable_prometheus:
prometheus_operator_url = "https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.87.0/bundle.yaml"
manifests = local("curl -Lq " + prometheus_operator_url, quiet=True, echo_off=True)
k8s_yaml(manifests)
k8s_yaml("examples/prometheus_secure_metrics_scraper.yaml")
local_resource(
"generate",
cmd="make manifests && make generate",
deps=['api/', 'internal/controller'],
ignore=[
'api/*/*generated*',
'*/*/*test*',
'*/*/*/*test*',
],
auto_init=False,
labels=["operator"],
)
local_resource(
"go-compile",
"make build-linux-manager",
deps=['api/', 'cmd/','internal/'],
ignore=[
'*/*/*test*',
'*/*/*/*test*',
],
labels=['operator'],
resource_deps=[
'generate',
],
auto_init = False,
trigger_mode = TRIGGER_MODE_AUTO,
)
docker_build_with_restart(
image_repo,
".",
dockerfile = "./dev.Dockerfile",
entrypoint = ["/manager"],
only = [
"bin/manager_linux",
],
live_update = [
sync("bin/manager_linux", "/manager"),
],
)
if deploy_source == 'helm':
k8s_yaml(
helm('dist/chart', name='clickhouse-operator', set=[
"manager.image.repository="+image_repo,
"manager.image.tag=latest",
"manager.podSecurityContext=null",
"manager.containerSecurityContext=null",
]),
)
else:
k8s_yaml(kustomize('config/tilt'))
k8s_resource(
new_name='operator-deployment',
workload='clickhouse-operator-controller-manager',
labels=['operator'],
resource_deps=[
'generate',
],
)
if secure_clusters:
k8s_yaml('examples/cluster_with_ssl.yaml')
else:
k8s_yaml('examples/minimal.yaml')
k8s_resource(
new_name='clickhouse-operator-namespace',
objects=['clickhouse-operator-system:Namespace'],
labels=['operator'],
)
k8s_resource(
new_name='keeper',
objects=['sample:KeeperCluster:default'],
labels=['test'],
)
k8s_resource(
new_name='clickhouse',
objects=['sample:ClickHouseCluster:default'],
labels=['test'],
)