forked from knative-extensions/eventing-istio
-
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.
Include Channel’s ExternalName services in Istio mesh (knative-extens…
…ions#16) * Include Channel’s ExternalName services in Istio mesh Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Run hack/update-codegen.sh Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Format Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Test and release setup Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade dependencies Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add IMC and KafkaChannel tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Format and fix tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade dependencies Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add access to configmaps Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add config-features for testing and install script for dev Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Debug logging for istio enabled Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix controller Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Include knative-extensions/eventing-kafka-broker#3045 Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Use core zap Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix unit tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add unit tests Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade dependencies and artifacts Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix host name Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade dependencies Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade dependencies Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Upgrade deps and artifacts Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add full config-features Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix boilerplate check Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Improve log message Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * More boilerplate check fixes Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Update codegen Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
- Loading branch information
Showing
4,422 changed files
with
1,153,950 additions
and
2,782 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
third_party/istio/bin | ||
/third_party/istio/bin | ||
/eventing-istio.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,73 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"errors" | ||
"log" | ||
"net/http" | ||
"os" | ||
"time" | ||
|
||
"knative.dev/pkg/injection/sharedmain" | ||
"knative.dev/pkg/signals" | ||
|
||
istiofilteredfactory "knative.dev/eventing-istio/pkg/client/istio/injection/informers/factory/filtered" | ||
"knative.dev/eventing-istio/pkg/reconciler/service" | ||
) | ||
|
||
func main() { | ||
|
||
ctx := signals.NewContext() | ||
|
||
port := os.Getenv("PROBES_PORT") | ||
if port == "" { | ||
port = "8080" | ||
} | ||
|
||
// sets up liveness and readiness probes. | ||
server := http.Server{ | ||
ReadTimeout: 5 * time.Second, | ||
Handler: http.HandlerFunc(handler), | ||
Addr: ":" + port, | ||
} | ||
|
||
go func() { | ||
|
||
go func() { | ||
<-ctx.Done() | ||
_ = server.Shutdown(ctx) | ||
}() | ||
|
||
// start the web server on port and accept requests | ||
log.Printf("Readiness and health check server listening on port %s", port) | ||
|
||
if err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) { | ||
log.Fatal(err) | ||
} | ||
}() | ||
|
||
ctx = istiofilteredfactory.WithSelectors(ctx, service.IstioResourceSelector) | ||
|
||
sharedmain.MainWithContext(ctx, "eventing-istio-controller", | ||
service.NewController, | ||
) | ||
} | ||
|
||
func handler(w http.ResponseWriter, r *http.Request) { | ||
w.WriteHeader(http.StatusOK) | ||
} |
40 changes: 40 additions & 0 deletions
40
config/eventing-istio/controller/200-eventing-serviceaccount.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,40 @@ | ||
# 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. | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: eventing-istio-controller | ||
namespace: knative-eventing | ||
labels: | ||
app.kubernetes.io/version: devel | ||
app.kubernetes.io/name: knative-eventing | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: eventing-istio-controller | ||
labels: | ||
app.kubernetes.io/version: devel | ||
app.kubernetes.io/name: knative-eventing | ||
subjects: | ||
- kind: ServiceAccount | ||
name: eventing-istio-controller | ||
namespace: knative-eventing | ||
roleRef: | ||
kind: ClusterRole | ||
name: knative-eventing-istio-controller | ||
apiGroup: rbac.authorization.k8s.io |
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,110 @@ | ||
# 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. | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: eventing-istio-controller | ||
namespace: knative-eventing | ||
labels: | ||
knative.dev/high-availability: "true" | ||
app.kubernetes.io/component: eventing-istio-controller | ||
app.kubernetes.io/version: devel | ||
app.kubernetes.io/name: knative-eventing | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: eventing-istio-controller | ||
template: | ||
metadata: | ||
labels: | ||
app: eventing-istio-controller | ||
app.kubernetes.io/component: eventing-istio-controller | ||
app.kubernetes.io/version: devel | ||
app.kubernetes.io/name: knative-eventing | ||
spec: | ||
# To avoid node becoming SPOF, spread our replicas to different nodes. | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- podAffinityTerm: | ||
labelSelector: | ||
matchLabels: | ||
app: eventing-istio-controller | ||
topologyKey: kubernetes.io/hostname | ||
weight: 100 | ||
|
||
serviceAccountName: eventing-istio-controller | ||
enableServiceLinks: false | ||
containers: | ||
- name: eventing-istio-controller | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
image: ko://knative.dev/eventing-istio/cmd/controller | ||
|
||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
|
||
env: | ||
- name: SYSTEM_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: CONFIG_LOGGING_NAME | ||
value: config-logging | ||
- name: CONFIG_OBSERVABILITY_NAME | ||
value: config-observability | ||
- name: METRICS_DOMAIN | ||
value: knative.dev/eventing-istio | ||
# APIServerSource | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
|
||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
seccompProfile: | ||
type: RuntimeDefault | ||
|
||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: probes | ||
scheme: HTTP | ||
initialDelaySeconds: 20 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /readiness | ||
port: probes | ||
scheme: HTTP | ||
initialDelaySeconds: 20 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
|
||
ports: | ||
- name: metrics | ||
containerPort: 9090 | ||
- name: profiling | ||
containerPort: 8008 | ||
- name: probes | ||
containerPort: 8080 |
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,58 @@ | ||
# 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. | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: knative-eventing-istio-controller | ||
labels: | ||
app.kubernetes.io/version: devel | ||
app.kubernetes.io/name: knative-eventing | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- "services" | ||
- "configmaps" | ||
verbs: | ||
- "get" | ||
- "list" | ||
- "watch" | ||
|
||
- apiGroups: | ||
- "networking.istio.io" | ||
resources: | ||
- "destinationrules" | ||
verbs: &everything | ||
- "get" | ||
- "list" | ||
- "create" | ||
- "update" | ||
- "delete" | ||
- "patch" | ||
- "watch" | ||
|
||
# For leader election | ||
- apiGroups: | ||
- "coordination.k8s.io" | ||
resources: | ||
- "leases" | ||
verbs: *everything | ||
|
||
# For creating events and reporting errors | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- "events" | ||
verbs: *everything |
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.