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
Show file tree
Hide file tree
Changes from 17 commits
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
16 changes: 11 additions & 5 deletions docs/src/snap/howto/networking/default-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,27 @@ Once you have the name of the pod, run the following command to see Cilium's
status:

```sh
sudo k8s kubectl exec -it cilium-97vcw -n kube-system -c cilium-agent -- cilium status
sudo k8s kubectl exec -it cilium-97vcw -n kube-system -c cilium-agent \
-- cilium status
```

You should see a wide range of metrics and configuration values for your cluster.
You should see a wide range of metrics and configuration values for your
cluster.

## Disable Network

You can `disable` the built-in network:

``` {warning}
If you have an active cluster, disabling Network may impact external access to
services within your cluster.
Ensure that you have alternative configurations in place before disabling Network.
If you have an active cluster, disabling Network may impact external
access to services within your cluster.
Ensure that you have alternative configurations in place before
disabling Network.
```

If your underlying network is cilium you will have to run
`sudo k8s disable gateway` before disabling network.

```
sudo k8s disable network
```
Expand Down
23 changes: 23 additions & 0 deletions k8s/manifests/charts/ck-gateway/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions k8s/manifests/charts/ck-gateway/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: ck-gateway
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
20,389 changes: 20,389 additions & 0 deletions k8s/manifests/charts/ck-gateway/crds/customresourcedefinition.yaml

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions k8s/manifests/charts/ck-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "ck-gateway.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

louiseschmidtgen marked this conversation as resolved.
Show resolved Hide resolved
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "ck-gateway.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "ck-gateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "ck-gateway.labels" -}}
helm.sh/chart: {{ include "ck-gateway.chart" . }}
{{ include "ck-gateway.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "ck-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ck-gateway.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "ck-gateway.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "ck-gateway.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
189 changes: 189 additions & 0 deletions k8s/manifests/charts/ck-gateway/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: contour-gateway-provisioner
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- namespaces
- secrets
- services
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- get
- update
- apiGroups:
- ""
resources:
- secrets
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- update
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- backendtlspolicies
- gatewayclasses
- gateways
- grpcroutes
- httproutes
- referencegrants
- tcproutes
- tlsroutes
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- backendtlspolicies/status
- gatewayclasses/status
- gateways/status
- grpcroutes/status
- httproutes/status
- tcproutes/status
- tlsroutes/status
verbs:
- update
- apiGroups:
- gateway.networking.k8s.io
resources:
- gatewayclasses
- gateways
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- gatewayclasses/status
- gateways/status
verbs:
- update
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses/status
verbs:
- create
- get
- update
- apiGroups:
- projectcontour.io
resources:
- contourconfigurations
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- projectcontour.io
resources:
- contourconfigurations
- extensionservices
- httpproxies
- tlscertificatedelegations
verbs:
- get
- list
- watch
- apiGroups:
- projectcontour.io
resources:
- contourconfigurations/status
- extensionservices/status
- httpproxies/status
verbs:
- create
- get
- update
- apiGroups:
- projectcontour.io
resources:
- contourdeployments
verbs:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
- rolebindings
- roles
verbs:
- create
- delete
- get
- list
- update
- watch
13 changes: 13 additions & 0 deletions k8s/manifests/charts/ck-gateway/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: contour-gateway-provisioner
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: contour-gateway-provisioner
subjects:
- kind: ServiceAccount
name: contour-gateway-provisioner
namespace: projectcontour
39 changes: 39 additions & 0 deletions k8s/manifests/charts/ck-gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
control-plane: contour-gateway-provisioner
name: contour-gateway-provisioner
namespace: projectcontour
spec:
replicas: 1
selector:
matchLabels:
control-plane: contour-gateway-provisioner
template:
metadata:
labels:
control-plane: contour-gateway-provisioner
spec:
containers:
- args:
- gateway-provisioner
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
command: ["contour"]
image: ghcr.io/projectcontour/contour:v1.29.0
imagePullPolicy: IfNotPresent
name: contour-gateway-provisioner
resources:
requests:
cpu: 100m
memory: 70Mi
env:
- name: CONTOUR_PROVISIONER_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
serviceAccountName: contour-gateway-provisioner
terminationGracePeriodSeconds: 10
7 changes: 7 additions & 0 deletions k8s/manifests/charts/ck-gateway/templates/gatewayclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1beta1
metadata:
name: ck-gateway
spec:
controllerName: projectcontour.io/gateway-controller
Loading
Loading