Skip to content

Commit 93ae95a

Browse files
authored
Add Capacitor dashboard to devcluster (TraceMachina#1115)
This lets us view logs and deployment statuses of Kustomizations. The new dashboard is available via `localhost:9000`.
1 parent 0a05082 commit 93ae95a

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1beta2
3+
kind: OCIRepository
4+
metadata:
5+
name: capacitor
6+
namespace: flux-system
7+
spec:
8+
interval: 12h
9+
url: oci://ghcr.io/gimlet-io/capacitor-manifests
10+
ref:
11+
semver: ">=0.1.0"
12+
---
13+
apiVersion: kustomize.toolkit.fluxcd.io/v1
14+
kind: Kustomization
15+
metadata:
16+
name: capacitor
17+
namespace: flux-system
18+
spec:
19+
targetNamespace: flux-system
20+
interval: 1h
21+
retryInterval: 2m
22+
timeout: 5m
23+
wait: true
24+
prune: true
25+
path: "./"
26+
sourceRef:
27+
kind: OCIRepository
28+
name: capacitor
29+
---
30+
apiVersion: "cilium.io/v2"
31+
kind: CiliumNetworkPolicy
32+
metadata:
33+
name: allow-ingress-to-capacitor
34+
namespace: flux-system
35+
spec:
36+
endpointSelector:
37+
matchLabels:
38+
app.kubernetes.io/name: onechart
39+
app.kubernetes.io/instance: capacitor
40+
ingress:
41+
- fromEntities:
42+
- ingress
43+
- toPorts:
44+
- ports:
45+
- port: "9000"
46+
protocol: TCP

native-cli/components/embedded/kustomization.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ resources:
88
- nix2container-image-info.yaml
99
- trigger.yaml
1010
- update-image-tags.yaml
11+
- capacitor.yaml
1112
# - nativelink-gateways.yaml # Gateways are handled in Pulumi via the
1213
# NativeLinkGateways resource.

native-cli/components/embedded/nativelink-gateways.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,15 @@ spec:
5757
- name: tkn-gateway
5858
protocol: HTTP
5959
port: 80
60+
---
61+
apiVersion: gateway.networking.k8s.io/v1beta1
62+
kind: Gateway
63+
metadata:
64+
name: capacitor-gateway
65+
namespace: flux-system
66+
spec:
67+
gatewayClassName: cilium
68+
listeners:
69+
- name: capacitor-gateway
70+
protocol: HTTP
71+
port: 80

native-cli/components/embedded/nativelink-routes.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,20 @@ spec:
4949
backendRefs:
5050
- name: tekton-dashboard
5151
port: 9097
52+
---
53+
apiVersion: gateway.networking.k8s.io/v1
54+
kind: HTTPRoute
55+
metadata:
56+
name: capacitor-route
57+
namespace: flux-system
58+
spec:
59+
parentRefs:
60+
- sectionName: capacitor-gateway
61+
name: capacitor-gateway
62+
rules:
63+
- matches:
64+
- path:
65+
value: /
66+
backendRefs:
67+
- name: capacitor
68+
port: 9000

native-cli/components/loadbalancer.go

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ func (component *Loadbalancer) Install(
310310
"el-gateway": false,
311311
"hubble-gateway": false,
312312
"tkn-gateway": false,
313+
"capacitor-gateway": false,
313314
},
314315
), component.Gateways)
315316
if err != nil {

native-cli/programs/local.go

+12
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
155155
},
156156
}
157157

158+
capacitorGateway := components.Gateway{
159+
ExternalPort: 9000, //nolint:mnd
160+
InternalPort: 9000, //nolint:mnd
161+
Routes: []components.RouteConfig{
162+
{
163+
Prefix: "/",
164+
Cluster: "capacitor-gateway",
165+
},
166+
},
167+
}
168+
158169
nativelinkGateway := components.Gateway{
159170
ExternalPort: 8082, //nolint:mnd
160171
InternalPort: 8089, //nolint:mnd
@@ -184,6 +195,7 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
184195
"kind-loadbalancer",
185196
&components.Loadbalancer{
186197
Gateways: []components.Gateway{
198+
capacitorGateway,
187199
nativelinkGateway,
188200
hubbleGateway,
189201
tknGateway,

0 commit comments

Comments
 (0)