mirror of https://github.com/knative/serving.git
drop dev container as no one is maintaining it (#15460)
This commit is contained in:
parent
bf7dbbb46c
commit
6554a7d563
|
@ -1,27 +0,0 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json.
|
||||
{
|
||||
"name": "Knative Serving",
|
||||
"image": "gcr.io/knative-tests/test-infra/prow-tests:latest",
|
||||
"privileged": true,
|
||||
"onCreateCommand": "echo 'source ${HOME}/.gvm/scripts/gvm' >> ~/.bashrc",
|
||||
|
||||
// Creates a local container registry, a Kind cluster, and deploys Knative Serving and Knative Ingress
|
||||
// To explore the setup logs, use the "Codespaces: View Creation Log" command in the Command Palette (Cmd/Ctrl + Shift + P or F1)
|
||||
"postCreateCommand": "bash .devcontainer/setup.sh",
|
||||
"postStartCommand": "bash .devcontainer/docker-start.sh",
|
||||
|
||||
"forwardPorts": [
|
||||
5001
|
||||
],
|
||||
"containerEnv": {
|
||||
"KO_DOCKER_REPO": "kind.local"
|
||||
},
|
||||
|
||||
"mounts": [
|
||||
{
|
||||
"source": "dind-var-lib-docker",
|
||||
"target": "/docker-graph",
|
||||
"type": "volume"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023 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 -eux
|
||||
|
||||
if ! docker info > /dev/null 2>&1; then
|
||||
echo "Starting docker..."
|
||||
service docker start
|
||||
fi
|
|
@ -1,117 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023 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 -eux
|
||||
|
||||
.devcontainer/docker-start.sh
|
||||
|
||||
until docker info > /dev/null 2>&1 ; do
|
||||
echo "Waiting for docker to start..."
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
echo "Setting up local container registry..."
|
||||
REGISTRY_NAME='registry.local'
|
||||
REGISTRY_PORT='5001'
|
||||
|
||||
if [ "$(docker inspect -f '{{.State.Running}}' "${REGISTRY_NAME}" 2>/dev/null || true)" != 'true' ]; then
|
||||
docker run \
|
||||
-d --restart=always -p "127.0.0.1:${REGISTRY_PORT}:5000" --name "${REGISTRY_NAME}" \
|
||||
registry:2
|
||||
fi
|
||||
|
||||
if kind get clusters | grep kind ; then
|
||||
echo "KinD cluster already exists, skipping..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Creating KinD cluster..."
|
||||
cat <<EOF | kind create cluster --config=-
|
||||
|
||||
kind: Cluster
|
||||
apiVersion: kind.x-k8s.io/v1alpha4
|
||||
containerdConfigPatches:
|
||||
- |-
|
||||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${REGISTRY_PORT}"]
|
||||
endpoint = ["http://${REGISTRY_NAME}:5000"]
|
||||
EOF
|
||||
|
||||
echo "Connecting registry to KinD cluster..."
|
||||
if [ "$(docker inspect -f='{{json .NetworkSettings.Networks.kind}}' "${REGISTRY_NAME}")" = 'null' ]; then
|
||||
docker network connect "kind" "${REGISTRY_NAME}"
|
||||
fi
|
||||
|
||||
# Document the local registry
|
||||
# https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: local-registry-hosting
|
||||
namespace: kube-public
|
||||
data:
|
||||
localRegistryHosting.v1: |
|
||||
host: "localhost:${REGISTRY_PORT}"
|
||||
help: "https://kind.sigs.k8s.io/docs/user/local-registry/"
|
||||
EOF
|
||||
|
||||
echo "Installs metal-lb..."
|
||||
curl https://raw.githubusercontent.com/metallb/metallb/v0.13.5/config/manifests/metallb-native.yaml -k |
|
||||
sed '0,/args:/s//args:\n - --webhook-mode=disabled/' |
|
||||
sed '/apiVersion: admissionregistration/,$d' |
|
||||
kubectl apply -f -
|
||||
|
||||
# Add Layer 2 config
|
||||
network=$(docker network inspect kind -f "{{(index .IPAM.Config 0).Subnet}}" | cut -d '.' -f1,2)
|
||||
echo $network
|
||||
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: IPAddressPool
|
||||
metadata:
|
||||
name: first-pool
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
addresses:
|
||||
- $network.255.1-$network.255.250
|
||||
---
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: L2Advertisement
|
||||
metadata:
|
||||
name: example
|
||||
namespace: metallb-system
|
||||
EOF
|
||||
|
||||
echo "Deploying cert-manager..."
|
||||
kubectl apply -f ./third_party/cert-manager-latest/cert-manager.yaml
|
||||
kubectl wait --for=condition=Established --all crd
|
||||
kubectl wait --for=condition=Available -n cert-manager --all deployments
|
||||
|
||||
echo "Deploying Knative Serving..."
|
||||
ko apply --selector knative.dev/crd-install=true -Rf config/core/
|
||||
kubectl wait --for=condition=Established --all crd
|
||||
ko apply -Rf config/core/
|
||||
|
||||
echo "Setting up sslip.io domain name"
|
||||
ko delete -f config/post-install/default-domain.yaml --ignore-not-found
|
||||
ko apply -f config/post-install/default-domain.yaml
|
||||
|
||||
echo "Deploying Knative ingress with Kourier..."
|
||||
kubectl apply -f ./third_party/kourier-latest/kourier.yaml
|
||||
kubectl patch configmap/config-network \
|
||||
-n knative-serving \
|
||||
--type merge \
|
||||
-p '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
|
|
@ -23,18 +23,6 @@ Start by creating [a GitHub account](https://github.com/join), then set up
|
|||
|
||||
### Install requirements
|
||||
|
||||
#### Getting started with GitHub Codespaces
|
||||
|
||||
To get started, create a codespace for this repository by clicking this 👇
|
||||
|
||||
[](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=118828329)
|
||||
|
||||
A codespace will open in a web-based version of Visual Studio Code. The [dev container](.devcontainer/devcontainer.json) is fully configured with software needed for this project. It creates a local container registry, a Kind cluster and deploys Knative Serving and Knative Ingress. If you use a codespace, then you can directly skip to the [Iterating](#Iterating) section of this document.
|
||||
|
||||
**Note**: Dev containers is an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other tools](https://containers.dev/supporting).
|
||||
|
||||
#### Local Setup
|
||||
|
||||
You must install these tools:
|
||||
|
||||
1. [`go`](https://golang.org/doc/install): The language `Knative Serving` is
|
||||
|
|
Loading…
Reference in New Issue