Skip to content

Commit

Permalink
Check LRE without flux
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani committed Aug 29, 2024
1 parent ef183b6 commit 4b8c51c
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 99 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ jobs:
- name: Start Kubernetes cluster (Application)
run: >
nix develop --impure --command
bash -c "./deployment-examples/kubernetes/02_application.sh"
bash -c "
./deployment-examples/kubernetes/01_operations.sh &
sleep 5
nix develop --impure --command tkn pr logs -f -L
wait"
- name: Get gateway IPs
id: gateway-ips
Expand Down
92 changes: 46 additions & 46 deletions native-cli/components/embedded/capacitor.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +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
# ---
# 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
2 changes: 1 addition & 1 deletion native-cli/components/embedded/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ resources:
- nix2container-image-info.yaml
- trigger.yaml
- update-image-tags.yaml
- capacitor.yaml
# - capacitor.yaml
# - nativelink-gateways.yaml # Gateways are handled in Pulumi via the
# NativeLinkGateways resource.
24 changes: 12 additions & 12 deletions native-cli/components/embedded/nativelink-gateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +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
# ---
# 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
34 changes: 17 additions & 17 deletions native-cli/components/embedded/nativelink-routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +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
# ---
# 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: 0 additions & 1 deletion native-cli/components/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ func (component *Loadbalancer) Install(
"el-gateway": false,
"hubble-gateway": false,
"tkn-gateway": false,
"capacitor-gateway": false,
},
), component.Gateways)
if err != nil {
Expand Down
41 changes: 20 additions & 21 deletions native-cli/programs/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
os.Exit(1)
}

flux, err := components.AddComponent(
ctx,
"flux",
&components.Flux{Version: "2.3.0"},
)
if err != nil {
log.Println(err)
os.Exit(1)
}
// flux, err := components.AddComponent(
// ctx,
// "flux",
// &components.Flux{Version: "2.3.0"},
// )
// if err != nil {
// log.Println(err)
// os.Exit(1)
// }

tektonPipelines, err := components.AddComponent(
ctx,
Expand Down Expand Up @@ -116,7 +116,6 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
tektonTriggers,
localSources,
nixStore,
flux,
),
},
))
Expand Down Expand Up @@ -167,16 +166,16 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
},
}

capacitorGateway := components.Gateway{
ExternalPort: 9000, //nolint:mnd
InternalPort: 9000, //nolint:mnd
Routes: []components.RouteConfig{
{
Prefix: "/",
Cluster: "capacitor-gateway",
},
},
}
// 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
Expand Down Expand Up @@ -207,7 +206,7 @@ func ProgramForLocalCluster(ctx *pulumi.Context) error {
"kind-loadbalancer",
&components.Loadbalancer{
Gateways: []components.Gateway{
capacitorGateway,
// capacitorGateway,
nativelinkGateway,
hubbleGateway,
tknGateway,
Expand Down

0 comments on commit 4b8c51c

Please sign in to comment.