Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8df08c4
Start on the new Stub bus controller and provisioner.
Harwayne Sep 28, 2018
e2c2f1f
Start on unit tests.
Harwayne Sep 28, 2018
b632f71
Fulfill Sinkable and Subscribable.
Harwayne Sep 28, 2018
eb2c458
Merge updates from fanout.
Harwayne Oct 1, 2018
13a912b
Merge branch 'master' into split-stub
Harwayne Oct 1, 2018
e87adf0
Rename to in-memory bus.
Harwayne Oct 2, 2018
a9bb764
Add unit tests for the ClusterProvisioner Controller.
Harwayne Oct 2, 2018
10034f6
Add unit tests for the Channel reconciler.
Harwayne Oct 3, 2018
906e8f9
Rename in-memory-bus-provisioner to in-memory-channel, as requested i…
Harwayne Oct 3, 2018
437d2df
Add a README.md.
Harwayne Oct 3, 2018
8dbaeee
Typo.
Harwayne Oct 3, 2018
9c1654f
Use a service account with specific RBAC permissions.
Harwayne Oct 5, 2018
c1d3082
hack/update-deps.sh
Harwayne Oct 5, 2018
99bc3e4
Merge branch 'master' into split-stub
Harwayne Oct 5, 2018
9e014e9
isio -> istio
Harwayne Oct 5, 2018
4a8f264
Respond to PR comments.
Harwayne Oct 9, 2018
af00150
ConfigMap create ClusterRole cannot be bound by resourceName.
Harwayne Oct 10, 2018
1d73bba
Watch K8s Services and VirtualServices.
Harwayne Oct 10, 2018
fd0efd4
Merge branch 'master' into split-stub
Harwayne Oct 11, 2018
a3aaf5a
Re-add SerializeConfig (accidentally removed during last merge).
Harwayne Oct 11, 2018
0a75ae7
goimports
Harwayne Oct 11, 2018
e955a14
Collapse if conditions.
Harwayne Oct 11, 2018
c79aa43
Only reconcile Channels.
Harwayne Oct 11, 2018
73f94b9
Merge branch 'master' into split-stub
Harwayne Oct 11, 2018
d32d44d
Manipulate Status only via methods on the Status object.
Harwayne Oct 11, 2018
486a2ba
Don't rely on the default values for sidecar flags.
Harwayne Oct 11, 2018
9fa1d96
Allow in-memory channels to be used without Istio sidecar injection.
Harwayne Oct 15, 2018
8dce929
Merge branch 'master' into public-channels
Harwayne Oct 18, 2018
bd3bfe9
Add Type to the K8s Service spec.
Harwayne Oct 18, 2018
98d9bf4
Switch to knative-shared-gateway.
Harwayne Oct 18, 2018
978905c
Create a private Knative Eventing only Ingress Gateway.
Harwayne Oct 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/fanoutsidecar/kodata/VENDOR-LICENSE
256 changes: 256 additions & 0 deletions config/provisioners/in-memory-channel/in-memory-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,259 @@ spec:
- --config_map_noticer=watcher
- --config_map_namespace=knative-eventing
- --config_map_name=in-memory-channel-dispatcher-config-map

---

# From here to the end of the file is essentially a copied version of
# https://github.com/knative/serving/blob/master/config/202-gateway.yaml, with the names and labels
# changed. It also switches the Service from LoadBalancer -> ClusterIP so that it cannot be
# reached from outside the cluster.
#
# Ideally we would not copy paste this much code, which has to stay in-sync with Istio itself.
#
# Overall we are createing a Gateway, the Service that backs it, the Deployment that backs that
# Service, and the Autoscaler that scales the Deployment.

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: knative-eventing-private-ingressgateway
namespace: istio-system
spec:
selector:
knative-eventing: private-ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "*"
tls:
mode: PASSTHROUGH

---


apiVersion: v1
kind: Service
metadata:
name: knative-eventing-private-ingressgateway
namespace: istio-system
annotations:
labels:
chart: gateways-1.0.1
release: RELEASE-NAME
heritage: Tiller
app: knative-eventing-private-ingressgateway
knative-eventing: private-ingressgateway
spec:
type: ClusterIP
selector:
app: knative-eventing-private-ingressgateway
knative-eventing: private-ingressgateway
ports:
-
name: http2
port: 80
targetPort: 80
-
name: https
port: 443
-
name: tcp
port: 31400
-
name: tcp-pilot-grpc-tls
port: 15011
targetPort: 15011
-
name: tcp-citadel-grpc-tls
port: 8060
targetPort: 8060
-
name: tcp-dns-tls
port: 853
targetPort: 853
-
name: http2-prometheus
port: 15030
targetPort: 15030
-
name: http2-grafana
port: 15031
targetPort: 15031
---
# This is the corresponding Deployment to backed the aforementioned Service.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: knative-eventing-private-ingressgateway
namespace: istio-system
labels:
chart: gateways-1.0.1
release: RELEASE-NAME
heritage: Tiller
app: knative-eventing-private-ingressgateway
knative-eventing: private-ingressgateway
spec:
replicas: 1
selector:
matchLabels: &labels
app: knative-eventing-private-ingressgateway
knative-eventing: private-ingressgateway
template:
metadata:
labels: *labels
annotations:
sidecar.istio.io/inject: "false"
scheduler.alpha.kubernetes.io/critical-pod: ""
spec:
serviceAccountName: istio-ingressgateway-service-account
containers:
- name: istio-proxy
image: "docker.io/istio/proxyv2:1.0.2"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
- containerPort: 443
- containerPort: 31400
- containerPort: 15011
- containerPort: 8060
- containerPort: 853
- containerPort: 15030
- containerPort: 15031
args:
- proxy
- router
- -v
- "2"
- --discoveryRefreshDelay
- '1s' #discoveryRefreshDelay
- --drainDuration
- '45s' #drainDuration
- --parentShutdownDuration
- '1m0s' #parentShutdownDuration
- --connectTimeout
- '10s' #connectTimeout
- --serviceCluster
- knative-ingressgateway
- --zipkinAddress
- zipkin:9411
- --statsdUdpAddress
- istio-statsd-prom-bridge:9125
- --proxyAdminPort
- "15000"
- --controlPlaneAuthPolicy
- NONE
- --discoveryAddress
- istio-pilot:8080
resources:
requests:
cpu: 10m

env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: INSTANCE_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: ISTIO_META_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- name: istio-certs
mountPath: /etc/certs
readOnly: true
- name: ingressgateway-certs
mountPath: "/etc/istio/ingressgateway-certs"
readOnly: true
- name: ingressgateway-ca-certs
mountPath: "/etc/istio/ingressgateway-ca-certs"
readOnly: true
volumes:
- name: istio-certs
secret:
secretName: istio.istio-ingressgateway-service-account
optional: true
- name: ingressgateway-certs
secret:
secretName: "istio-ingressgateway-certs"
optional: true
- name: ingressgateway-ca-certs
secret:
secretName: "istio-ingressgateway-ca-certs"
optional: true
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 2
preference:
matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
values:
- amd64
- weight: 2
preference:
matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
values:
- ppc64le
- weight: 2
preference:
matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
values:
- s390x
---

# This is the horizontal pod autoscaler to make sure the ingress Pods
# scale up to meet traffic demand.
#
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: knative-eventing-private-ingressgateway
namespace: istio-system
spec:
# TODO(1411): Document/fix this. We are choosing an arbitrary 10 here.
maxReplicas: 10
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: knative-eventing-private-ingressgateway
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 60
16 changes: 9 additions & 7 deletions pkg/controller/eventing/inmemory/channel/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ import (
)

const (
portName = "http"
portNumber = 80
finalizerName = controllerAgentName

privateEventingIngressGateway = "knative-eventing-private-ingressgateway.istio-system.svc.cluster.local"
)

type reconciler struct {
Expand Down Expand Up @@ -257,12 +258,9 @@ func newK8sService(c *eventingv1alpha1.Channel) *corev1.Service {
},
},
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{
{
Name: portName,
Port: portNumber,
},
},
Type: corev1.ServiceTypeExternalName,
// Keep in sync with the Gateway in newVirtualService().
ExternalName: privateEventingIngressGateway,
},
}
}
Expand Down Expand Up @@ -290,6 +288,10 @@ func newVirtualService(channel *eventingv1alpha1.Channel) *istiov1alpha3.Virtual
},
},
Spec: istiov1alpha3.VirtualServiceSpec{
Gateways: []string{
privateEventingIngressGateway,
"mesh",
},
Hosts: []string{
controller.ServiceHostName(controller.ChannelServiceName(channel.Name), channel.Namespace),
controller.ChannelHostName(channel.Name, channel.Namespace),
Expand Down
12 changes: 6 additions & 6 deletions pkg/controller/eventing/inmemory/channel/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,8 @@ func makeK8sService() *corev1.Service {
},
},
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{
{
Name: portName,
Port: portNumber,
},
},
Type: corev1.ServiceTypeExternalName,
ExternalName: privateEventingIngressGateway,
},
}
}
Expand Down Expand Up @@ -630,6 +626,10 @@ func makeVirtualService() *istiov1alpha3.VirtualService {
},
},
Spec: istiov1alpha3.VirtualServiceSpec{
Gateways: []string{
privateEventingIngressGateway,
"mesh",
},
Hosts: []string{
fmt.Sprintf("%s-channel.%s.svc.cluster.local", cName, cNamespace),
fmt.Sprintf("%s.%s.channels.cluster.local", cName, cNamespace),
Expand Down