net-gateway-api

module
v0.35.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: Apache-2.0

README

Knative net-gateway-api

This component is ALPHA

GoDoc Go Report Card

net-gateway-api repository contains a KIngress implementation and testing for Knative integration with the Kubernetes Gateway API.

This work is still in early development, which means it's not ready for production, but also that your feedback can have a big impact. You can find the tested Ingress and unavailable features here.

This work is still in early development, which means it's not ready for production, but also that your feedback can have a big impact. You can also find the tested Ingress and unavailable features here.

Tests

Note: conformance and e2e tests are a wip at the moment. Please see:

Versions to be installed are listed in hack/test-env.sh.

Requirements

  1. A Kind cluster
  2. Knative serving installed
  3. ko (for installing the net-gateway-api)
  4. kubectl
  5. export KO_DOCKER_REPO=kind.local

Getting started

Install Knative serving
kubectl apply -f https://github.com/knative/serving/releases/latest/download/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/latest/download/serving-core.yaml
Configure Knative
Ingress

Configuration so Knative serving uses the proper "ingress.class":

kubectl patch configmap/config-network \
  -n knative-serving \
  --type merge \
  -p '{"data":{"ingress.class":"gateway-api.ingress.networking.knative.dev"}}'
Load balancer

Configuration so Knative serving uses nip.io for DNS. For kind the loadbalancer IP is 127.0.0.1:

kubectl patch configmap/config-domain \
  -n knative-serving \
  --type merge \
  -p '{"data":{"127.0.0.1.nip.io":""}}'
(OPTIONAL) Deploy a sample hello world app:
cat <<-EOF | kubectl apply -f -
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: helloworld-go
spec:
  template:
    spec:
      containers:
      - image: gcr.io/knative-samples/helloworld-go
        env:
        - name: TARGET
          value: Go Sample v1
EOF
Install net-gateway-api
ko apply -f config/
Load tested environment versions
source ./hack/test-env.sh
Install a supported implementation
Istio
# gateway-api CRD must be installed before Istio.
echo ">> Installing Gateway API CRDs"
kubectl apply -f config/100-gateway-api.yaml

echo ">> Bringing up Istio"
curl -sL https://istio.io/downloadIstioctl | sh -
"$HOME"/.istioctl/bin/istioctl install -y --set values.gateways.istio-ingressgateway.type=NodePort --set values.global.proxy.clusterDomain="${CLUSTER_SUFFIX}"

echo ">> Deploy Gateway API resources"
kubectl apply -f ./third_party/istio/gateway/
Contour
echo ">> Bringing up Contour"
kubectl apply -f "https://raw.githubusercontent.com/projectcontour/contour-operator/${CONTOUR_VERSION}/examples/operator/operator.yaml"

# wait for operator deployment to be Available
kubectl wait deploy --for=condition=Available --timeout=120s -n "contour-operator" -l '!job-name'

echo ">> Deploy Gateway API resources"
ko resolve -f ./third_party/contour/gateway/ | \
  sed 's/LoadBalancerService/NodePortService/g' | \
  kubectl apply -f -
(OPTIONAL) For testing purpose (Istio)

You can use port-forwarding to make requests to ingress from your machine:

kubectl port-forward  -n istio-system $(kubectl get pod -n istio-system -l "app=istio-ingressgateway" --output=jsonpath="{.items[0].metadata.name}") 8080:8080

curl -v -H "Host: helloworld-go.default.127.0.0.1.nip.io" http://localhost:8080

To learn more about Knative, please visit our Knative docs repository.

If you are interested in contributing, see CONTRIBUTING.md and DEVELOPMENT.md.

Directories

Path Synopsis
cmd
pkg
client/gatewayapi/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/gatewayapi/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/gatewayapi/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/gatewayapi/clientset/versioned/typed/apis/v1alpha2
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/gatewayapi/clientset/versioned/typed/apis/v1alpha2/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
ha
third_party
VENDOR-LICENSE/github.com/hashicorp/golang-lru
Package lru provides three different LRU caches of varying sophistication.
Package lru provides three different LRU caches of varying sophistication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL