Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contour Ingress & Gateway #468

Merged
merged 82 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ecb72d2
put a little note in docs on disabling network
louiseschmidtgen Jun 4, 2024
b75fbdf
first draft of contour ingress and gateway
louiseschmidtgen Jun 4, 2024
cafb944
put contour chart
louiseschmidtgen Jun 4, 2024
022a454
minor fixes
louiseschmidtgen Jun 5, 2024
0e2e8be
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 5, 2024
e1cd4f2
put some fakes
louiseschmidtgen Jun 5, 2024
a0a36c3
more wip
louiseschmidtgen Jun 5, 2024
f64a160
helm client create ns for contour
louiseschmidtgen Jun 5, 2024
8a7ea3d
gateway
louiseschmidtgen Jun 5, 2024
7a56bf7
testy yamls
louiseschmidtgen Jun 6, 2024
bb8a017
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 6, 2024
f6c3467
gateway provisioner
louiseschmidtgen Jun 6, 2024
7de6325
ck-gateway
louiseschmidtgen Jun 6, 2024
33dcb04
more gateway
louiseschmidtgen Jun 6, 2024
c7de1e6
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 6, 2024
81d8632
gateway provider manifest to chart
louiseschmidtgen Jun 6, 2024
f8e34a7
remove that
louiseschmidtgen Jun 6, 2024
a19d225
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 10, 2024
af0e7bb
add mini tls delegation chart
louiseschmidtgen Jun 10, 2024
a9b6244
some cleanup
louiseschmidtgen Jun 10, 2024
2d834b7
set use-proxy-protocol
louiseschmidtgen Jun 10, 2024
3ec3321
yamling, put shared crds in their own chart
louiseschmidtgen Jun 11, 2024
8fefda8
forgot this yaml
louiseschmidtgen Jun 11, 2024
421c9ed
some more comments
louiseschmidtgen Jun 11, 2024
b329ec9
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 11, 2024
de33da7
gateway class renamed ck-gateway, some renaming
louiseschmidtgen Jun 11, 2024
958a6ec
testing adjustments & cleanup
louiseschmidtgen Jun 12, 2024
2d5627b
fix ingress class name
louiseschmidtgen Jun 12, 2024
53155dc
fix cilium ingress class
louiseschmidtgen Jun 12, 2024
3a94715
try improve tests
louiseschmidtgen Jun 12, 2024
e916d2a
lint
louiseschmidtgen Jun 12, 2024
a9cf9d1
lint2
louiseschmidtgen Jun 12, 2024
04f6c71
lint
louiseschmidtgen Jun 12, 2024
057adc4
fix test
louiseschmidtgen Jun 13, 2024
7fddaa7
change contour chart version
louiseschmidtgen Jun 13, 2024
d4665f5
update component contour
louiseschmidtgen Jun 13, 2024
986455a
update ingress test
louiseschmidtgen Jun 13, 2024
811dd63
little typo
louiseschmidtgen Jun 13, 2024
25d919a
ingressClassName patch
louiseschmidtgen Jun 13, 2024
4717538
typo
louiseschmidtgen Jun 13, 2024
22b30f7
cleanup cilium ingress class
louiseschmidtgen Jun 13, 2024
88246cc
update dir
louiseschmidtgen Jun 13, 2024
b1d960e
cleanup
louiseschmidtgen Jun 13, 2024
826859d
make contour charts updatable
louiseschmidtgen Jun 13, 2024
bf4d38d
fix gateway yamls
louiseschmidtgen Jun 13, 2024
9fb12ac
comments
louiseschmidtgen Jun 13, 2024
c0ce364
lost braket,
louiseschmidtgen Jun 16, 2024
e52a1b2
beautify
louiseschmidtgen Jun 16, 2024
38e4722
comments
louiseschmidtgen Jun 16, 2024
b4ef1ff
move tlscertdelegation
louiseschmidtgen Jun 16, 2024
eea515e
lint
louiseschmidtgen Jun 16, 2024
c8f5678
undo move enabled config
louiseschmidtgen Jun 16, 2024
f9e4cb6
update charts
louiseschmidtgen Jun 17, 2024
9191039
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 17, 2024
8f14830
match on label my-gateway
louiseschmidtgen Jun 17, 2024
fb73341
improve label check
louiseschmidtgen Jun 17, 2024
e659dc1
linter
louiseschmidtgen Jun 17, 2024
a1988f9
make ingress check more precise
louiseschmidtgen Jun 17, 2024
d5baf81
update helm pull for contour
louiseschmidtgen Jun 19, 2024
622e28b
wait for contour common crds
louiseschmidtgen Jun 19, 2024
ecb1cb1
add missing returns
louiseschmidtgen Jun 19, 2024
a64cfcf
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 19, 2024
e02ed53
change name in api resources await
louiseschmidtgen Jun 19, 2024
cf6c70a
change chart helm pull
louiseschmidtgen Jun 19, 2024
b3fad77
missed a little name change
louiseschmidtgen Jun 19, 2024
c138ed6
comment update
louiseschmidtgen Jun 19, 2024
f0d1654
update resources for group version
louiseschmidtgen Jun 19, 2024
e2c8eed
rewrite wait for crds for two groups
louiseschmidtgen Jun 19, 2024
365523e
update wait for crds
louiseschmidtgen Jun 20, 2024
164fb97
the rest of my comment
louiseschmidtgen Jun 20, 2024
854f205
maybe now I understand api group conventions
louiseschmidtgen Jun 20, 2024
854846d
Revert "maybe now I understand api group conventions"
louiseschmidtgen Jun 20, 2024
58de94f
correct api-resource name
louiseschmidtgen Jun 20, 2024
501242e
update chart helm pull
louiseschmidtgen Jun 20, 2024
d66b867
remove resource.group check optional param
louiseschmidtgen Jun 20, 2024
e5ad071
cleanup
louiseschmidtgen Jun 20, 2024
8836e79
make it two loops
louiseschmidtgen Jun 20, 2024
77094df
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 20, 2024
01f9a88
add images
louiseschmidtgen Jun 20, 2024
fd0df08
Merge remote-tracking branch 'origin/main' into KU-864/contour
louiseschmidtgen Jun 21, 2024
614f5bf
comments
louiseschmidtgen Jun 21, 2024
6ad1d90
Merge 'origin/main' into KU-864/contour
louiseschmidtgen Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions src/k8s/pkg/k8sd/features/contour/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,48 @@ func waitForRequiredContourCommonCRDs(ctx context.Context, snap snap.Snap) error
return fmt.Errorf("failed to create Kubernetes client: %w", err)
}

return control.WaitUntilReady(ctx, func() (bool, error) {
resources, err := client.ListResourcesForGroupVersion("projectcontour.io/v1alpha1")
requiredCRDs := map[string][]string{
"projectcontour.io/v1alpha1": {
"contourconfigurations.projectcontour.io",
"contourdeployments.projectcontour.io",
"extensionservices.projectcontour.io",
},
"projectcontour.io/v1": {
"tlscertificatedelegations.projectcontour.io",
"httpproxies.projectcontour.io",
},
}

// checkRequiredCRDs checks if the required CRDs are present in the cluster.
checkRequiredCRDs := func(groupVersion string, required []string) (bool, error) {
resources, err := client.ListResourcesForGroupVersion(groupVersion)
if err != nil {
// This error is expected if the group version is not yet deployed.
return false, nil
}

requiredCRDs := map[string]bool{
"contourconfigurations.projectcontour.io": true,
"contourdeployments.projectcontour.io": true,
"extensionservices.projectcontour.io": true,
"httpproxies.projectcontour.io": true,
"tlscertificatedelegations.projectcontour.io": true,
louiseschmidtgen marked this conversation as resolved.
Show resolved Hide resolved
requiredMap := make(map[string]bool)
for _, crd := range required {
requiredMap[crd] = true
}

requiredCount := len(requiredCRDs)
for _, resource := range resources.APIResources {
if _, exists := requiredCRDs[resource.Name]; exists {
requiredCount--
delete(requiredMap, resource.Name)
louiseschmidtgen marked this conversation as resolved.
Show resolved Hide resolved
}

return len(requiredMap) == 0, nil
}

return control.WaitUntilReady(ctx, func() (bool, error) {
for groupVersion, crds := range requiredCRDs {
ready, err := checkRequiredCRDs(groupVersion, crds)
if err != nil {
return false, err
}
if !ready {
return false, nil
}
}
return requiredCount == 0, nil
return true, nil
})
}
Loading