Skip to content

Commit

Permalink
Add Capacitor dashboard to devcluster (TraceMachina#1115)
Browse files Browse the repository at this point in the history
This lets us view logs and deployment statuses of Kustomizations.

The new dashboard is available via `localhost:9000`.
  • Loading branch information
aaronmondal authored Jul 9, 2024
1 parent 0a05082 commit 93ae95a
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
46 changes: 46 additions & 0 deletions native-cli/components/embedded/capacitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: capacitor
namespace: flux-system
spec:
interval: 12h
url: oci://ghcr.io/gimlet-io/capacitor-manifests
ref:
semver: ">=0.1.0"
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: capacitor
namespace: flux-system
spec:
targetNamespace: flux-system
interval: 1h
retryInterval: 2m
timeout: 5m
wait: true
prune: true
path: "./"
sourceRef:
kind: OCIRepository
name: capacitor
---
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: allow-ingress-to-capacitor
namespace: flux-system
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: onechart
app.kubernetes.io/instance: capacitor
ingress:
- fromEntities:
- ingress
- toPorts:
- ports:
- port: "9000"
protocol: TCP
1 change: 1 addition & 0 deletions native-cli/components/embedded/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ resources:
- nix2container-image-info.yaml
- trigger.yaml
- update-image-tags.yaml
- capacitor.yaml
# - nativelink-gateways.yaml # Gateways are handled in Pulumi via the
# NativeLinkGateways resource.
12 changes: 12 additions & 0 deletions native-cli/components/embedded/nativelink-gateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,15 @@ spec:
- name: tkn-gateway
protocol: HTTP
port: 80
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: capacitor-gateway
namespace: flux-system
spec:
gatewayClassName: cilium
listeners:
- name: capacitor-gateway
protocol: HTTP
port: 80
17 changes: 17 additions & 0 deletions native-cli/components/embedded/nativelink-routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,20 @@ spec:
backendRefs:
- name: tekton-dashboard
port: 9097
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: capacitor-route
namespace: flux-system
spec:
parentRefs:
- sectionName: capacitor-gateway
name: capacitor-gateway
rules:
- matches:
- path:
value: /
backendRefs:
- name: capacitor
port: 9000
1 change: 1 addition & 0 deletions native-cli/components/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (component *Loadbalancer) Install(
"el-gateway": false,
"hubble-gateway": false,
"tkn-gateway": false,
"capacitor-gateway": false,
},
), component.Gateways)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions native-cli/programs/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
},
}

capacitorGateway := components.Gateway{
ExternalPort: 9000, //nolint:mnd
InternalPort: 9000, //nolint:mnd
Routes: []components.RouteConfig{
{
Prefix: "/",
Cluster: "capacitor-gateway",
},
},
}

nativelinkGateway := components.Gateway{
ExternalPort: 8082, //nolint:mnd
InternalPort: 8089, //nolint:mnd
Expand Down Expand Up @@ -184,6 +195,7 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
"kind-loadbalancer",
&components.Loadbalancer{
Gateways: []components.Gateway{
capacitorGateway,
nativelinkGateway,
hubbleGateway,
tknGateway,
Expand Down

0 comments on commit 93ae95a

Please sign in to comment.