-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gateway API: update to v0.4.3, add validating webhook
Updates the version of Gateway API to v0.4.3 and adds the validating webhook from that version to Contour's example YAML files and E2E tests. Closes #3807. Signed-off-by: Steve Kriss <krisss@vmware.com>
- Loading branch information
Showing
14 changed files
with
810 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Updates Gateway API to v0.4.3 and adds the Gateway API validating webhook to Contour's Gateway API example YAML. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: gateway-api | ||
labels: | ||
name: gateway-api | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
name: gateway-api-admission | ||
webhooks: | ||
- name: validate.gateway.networking.k8s.io | ||
matchPolicy: Equivalent | ||
rules: | ||
- operations: [ "CREATE" , "UPDATE" ] | ||
apiGroups: [ "networking.x-k8s.io" ] | ||
apiVersions: [ "v1alpha1" ] | ||
resources: [ "gateways", "gatewayclasses", "httproutes" ] | ||
- operations: [ "CREATE" , "UPDATE" ] | ||
apiGroups: [ "gateway.networking.k8s.io" ] | ||
apiVersions: [ "v1alpha2" ] | ||
resources: [ "gateways", "gatewayclasses", "httproutes" ] | ||
failurePolicy: Fail | ||
sideEffects: None | ||
admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: gateway-api-admission-server | ||
namespace: gateway-api | ||
path: "/validate" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
name: gateway-api-webhook-server | ||
version: 0.0.1 | ||
name: gateway-api-admission-server | ||
namespace: gateway-api | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: https-webhook | ||
port: 443 | ||
targetPort: 8443 | ||
selector: | ||
name: gateway-api-admission-server | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: gateway-api-admission-server | ||
namespace: gateway-api | ||
labels: | ||
name: gateway-api-admission-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: gateway-api-admission-server | ||
template: | ||
metadata: | ||
name: gateway-api-admission-server | ||
labels: | ||
name: gateway-api-admission-server | ||
spec: | ||
containers: | ||
- name: webhook | ||
image: gcr.io/k8s-staging-gateway-api/admission-server:v0.4.3 | ||
imagePullPolicy: Always | ||
args: | ||
- -logtostderr | ||
- --tlsCertFile=/etc/certs/cert | ||
- --tlsKeyFile=/etc/certs/key | ||
- -v=10 | ||
- 2>&1 | ||
ports: | ||
- containerPort: 8443 | ||
name: webhook | ||
resources: | ||
limits: | ||
memory: 50Mi | ||
cpu: 100m | ||
requests: | ||
memory: 50Mi | ||
cpu: 100m | ||
volumeMounts: | ||
- name: webhook-certs | ||
mountPath: /etc/certs | ||
readOnly: true | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
volumes: | ||
- name: webhook-certs | ||
secret: | ||
secretName: gateway-api-admission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: gateway-api | ||
labels: | ||
name: gateway-api | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: gateway-api-admission | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: gateway-api-admission | ||
labels: | ||
name: gateway-api | ||
rules: | ||
- apiGroups: | ||
- admissionregistration.k8s.io | ||
resources: | ||
- validatingwebhookconfigurations | ||
verbs: | ||
- get | ||
- update | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: gateway-api-admission | ||
annotations: | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: gateway-api-admission | ||
subjects: | ||
- kind: ServiceAccount | ||
name: gateway-api-admission | ||
namespace: gateway-api | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: gateway-api-admission | ||
annotations: | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- secrets | ||
verbs: | ||
- get | ||
- create | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: gateway-api-admission | ||
annotations: | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: gateway-api-admission | ||
subjects: | ||
- kind: ServiceAccount | ||
name: gateway-api-admission | ||
namespace: gateway-api | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: gateway-api-admission | ||
annotations: | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
spec: | ||
template: | ||
metadata: | ||
name: gateway-api-admission-create | ||
labels: | ||
name: gateway-api-webhook | ||
spec: | ||
containers: | ||
- name: create | ||
image: k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- create | ||
- --host=gateway-api-admission-server,gateway-api-admission-server.gateway-api.svc | ||
- --namespace=gateway-api | ||
- --secret-name=gateway-api-admission | ||
env: | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
restartPolicy: OnFailure | ||
serviceAccountName: gateway-api-admission | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 2000 | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: gateway-api-admission-patch | ||
labels: | ||
name: gateway-api-webhook | ||
namespace: gateway-api | ||
spec: | ||
template: | ||
metadata: | ||
name: gateway-api-admission-patch | ||
labels: | ||
name: gateway-api-webhook | ||
spec: | ||
containers: | ||
- name: patch | ||
image: k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- patch | ||
- --webhook-name=gateway-api-admission | ||
- --namespace=gateway-api | ||
- --patch-mutating=false | ||
- --patch-validating=true | ||
- --secret-name=gateway-api-admission | ||
- --patch-failure-policy=Fail | ||
env: | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
restartPolicy: OnFailure | ||
serviceAccountName: gateway-api-admission | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 2000 |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.