Add Knative provider
This commit is contained in:
parent
3f23afb2c6
commit
13bcdebc89
38 changed files with 18589 additions and 37 deletions
6692
integration/fixtures/knative/00-knative-crd-v1.19.0.yml
Normal file
6692
integration/fixtures/knative/00-knative-crd-v1.19.0.yml
Normal file
File diff suppressed because it is too large
Load diff
50
integration/fixtures/knative/01-rbac.yml
Normal file
50
integration/fixtures/knative/01-rbac.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: knative-networking-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.internal.knative.dev
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.internal.knative.dev
|
||||
resources:
|
||||
- ingresses/status
|
||||
verbs:
|
||||
- update
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: traefik
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: knative-networking-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: traefik
|
||||
namespace: traefik
|
||||
102
integration/fixtures/knative/02-traefik.yml
Normal file
102
integration/fixtures/knative/02-traefik.yml
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
---
|
||||
kind: Namespace
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: traefik
|
||||
|
||||
---
|
||||
kind: ServiceAccount
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: traefik
|
||||
namespace: traefik
|
||||
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: traefik
|
||||
namespace: traefik
|
||||
labels:
|
||||
app: traefik
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: traefik
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: traefik
|
||||
spec:
|
||||
serviceAccountName: traefik
|
||||
containers:
|
||||
- name: traefik
|
||||
image: traefik/traefik:latest
|
||||
imagePullPolicy: Never
|
||||
args:
|
||||
- --api.insecure
|
||||
- --log.level=debug
|
||||
- --entrypoints.pweb.address=:80
|
||||
- --entrypoints.pwebsecure.address=:443
|
||||
- --entrypoints.privweb.address=:8080
|
||||
- --entrypoints.privwebsecure.address=:4443
|
||||
- --entrypoints.traefik.address=:9000
|
||||
- --experimental.knative
|
||||
- --providers.knative.publicEntrypoints=pweb,pwebsecure
|
||||
- --providers.knative.publicService.namespace=traefik
|
||||
- --providers.knative.publicService.name=traefik
|
||||
- --providers.knative.privateEntrypoints=privweb,privwebsecure
|
||||
- --providers.knative.privateService.namespace=traefik
|
||||
- --providers.knative.privateService.name=privtraefik
|
||||
- --providers.knative.throttleduration=2s
|
||||
|
||||
ports:
|
||||
- name: pweb
|
||||
containerPort: 80
|
||||
- name: pwebsecure
|
||||
containerPort: 443
|
||||
- name: privweb
|
||||
containerPort: 8080
|
||||
- name: privwebsecure
|
||||
containerPort: 4443
|
||||
- name: traefik
|
||||
containerPort: 9000
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: traefik
|
||||
namespace: traefik
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: traefik
|
||||
ports:
|
||||
- port: 80
|
||||
name: web
|
||||
targetPort: pweb
|
||||
- port: 443
|
||||
name: websecure
|
||||
targetPort: pwebsecure
|
||||
- port: 9000
|
||||
name: traefik
|
||||
targetPort: traefik
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: privtraefik
|
||||
namespace: traefik
|
||||
spec:
|
||||
selector:
|
||||
app: traefik
|
||||
ports:
|
||||
- port: 80
|
||||
name: web
|
||||
targetPort: privweb
|
||||
- port: 443
|
||||
name: websecure
|
||||
targetPort: privwebsecure
|
||||
9513
integration/fixtures/knative/03-knative-serving-v1.19.0.yaml
Normal file
9513
integration/fixtures/knative/03-knative-serving-v1.19.0.yaml
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: serving-tests
|
||||
14
integration/fixtures/knative/tools.go
Normal file
14
integration/fixtures/knative/tools.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
//go:build tools
|
||||
|
||||
package tools
|
||||
|
||||
// The following dependencies are required by the Knative conformance tests.
|
||||
// They allow to download the test_images when calling "go mod vendor".
|
||||
import (
|
||||
_ "knative.dev/networking/test/test_images/grpc-ping"
|
||||
_ "knative.dev/networking/test/test_images/httpproxy"
|
||||
_ "knative.dev/networking/test/test_images/retry"
|
||||
_ "knative.dev/networking/test/test_images/runtime"
|
||||
_ "knative.dev/networking/test/test_images/timeout"
|
||||
_ "knative.dev/networking/test/test_images/wsserver"
|
||||
)
|
||||
41
integration/fixtures/knative/upload-test-images.sh
Executable file
41
integration/fixtures/knative/upload-test-images.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2020 The Knative Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -o errexit
|
||||
|
||||
function upload_test_images() {
|
||||
echo ">> Publishing test images"
|
||||
(
|
||||
# Script needs to be executed from repo root
|
||||
cd "$( dirname "$0")/../../../"
|
||||
echo "Current working directory: $(pwd)"
|
||||
local image_dir="vendor/knative.dev/networking/test/test_images"
|
||||
local docker_tag=$1
|
||||
local tag_option=""
|
||||
if [ -n "${docker_tag}" ]; then
|
||||
tag_option="--tags $docker_tag,latest"
|
||||
fi
|
||||
|
||||
# ko resolve is being used for the side-effect of publishing images,
|
||||
# so the resulting yaml produced is ignored.
|
||||
# shellcheck disable=SC2086
|
||||
ko resolve --jobs=4 ${tag_option} -RBf "${image_dir}" > /dev/null
|
||||
)
|
||||
}
|
||||
|
||||
: "${KO_DOCKER_REPO:?"You must set 'KO_DOCKER_REPO', see DEVELOPMENT.md"}"
|
||||
|
||||
upload_test_images "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue