generated from knative-extensions/sample-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from salaboy/serving-controller
Serving controller
- Loading branch information
Showing
500 changed files
with
31,694 additions
and
18,429 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
.EXPORT_ALL_VARIABLES: | ||
SYSTEM_NAMESPACE ?= default | ||
METRICS_DOMAIN ?= example.com | ||
CLUSTER_NAME ?= knative-test | ||
EVENTSINK ?= http://localhost:10000 | ||
|
||
install-knative: | ||
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.1.0/serving-crds.yaml | ||
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.1.0/serving-core.yaml | ||
# install networking layer | kourier | ||
kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.1.0/kourier.yaml | ||
kubectl patch configmap/config-network \ | ||
--namespace knative-serving \ | ||
--type merge \ | ||
--patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}' | ||
|
||
|
||
install-crds: | ||
for crd in config/crds; \ | ||
do \ | ||
kubectl apply -f "$$crd"; \ | ||
done | ||
|
||
run-controllers: | ||
go run cmd/controller/main.go | ||
|
||
run-webhooks: | ||
go run cmd/webhook/main.go | ||
|
||
run-schema: | ||
go run cmd/schema/main.go dump SimpleDeployment | ||
|
||
cluster: | ||
kind create cluster --name ${CLUSTER_NAME} --config kind-config.yaml | ||
|
||
delete-cluster: | ||
kind delete cluster --name ${CLUSTER_NAME} |
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,34 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
cloudevents "github.com/cloudevents/sdk-go/v2" | ||
"knative.dev/sample-controller/pkg/server/models" | ||
) | ||
|
||
func main() { | ||
c, err := cloudevents.NewClientHTTP() | ||
if err != nil { | ||
log.Fatalf("failed to create client, %v", err) | ||
} | ||
|
||
// Create an Event. | ||
event := cloudevents.NewEvent() | ||
event.SetSource("example/uri") | ||
event.SetType(models.CreateKService.String()) | ||
event.SetData(cloudevents.ApplicationJSON, map[string]string{ | ||
"name": "hello", | ||
"namespace": "default", | ||
"image": "gcr.io/google-samples/hello-app:1.0", | ||
}) | ||
|
||
// Set a target. | ||
ctx := cloudevents.ContextWithTarget(context.Background(), "http://localhost:10000/") | ||
|
||
// Send that Event. | ||
if result := c.Send(ctx, event); cloudevents.IsUndelivered(result) { | ||
log.Fatalf("failed to send, %v", result) | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.