knative-extensions / knative-extensions/eventing-integrations

TLS/HTTPS sink is unable to receive events

Open
#52 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Running with TLS, on the `IntegrationSink` there is a timeout on sending events to the Sink. Here is a log for a "source dispatcher", in a test suite:

```
k -n test-mamiqzxh logs -f source-ztjipdjq
2024-12-13T08:02:11.297Z debug logging/config.go:116 Successfully created the logger.
2024-12-13T08:02:11.297Z debug logging/config.go:117 Logging level set to: debug
2024-12-13T08:02:11.297Z info logging/config.go:80 Unable to read vcs.revision from binary
2024-12-13T08:02:11.297Z info eventshub eventshub/eventshub.go:58 Events Hub environment configuration: {EventGenerators:[sender] EventLogs:[recorder logger]}
2024-12-13T08:02:11.297Z info eventshub recorder_vent/constructor.go:51 Recorder vent environment configuration: {AgentName:observer-default PodName:source-ztjipdjq Port:8080}
2024-12-13T08:02:11.302Z info eventshub recorder_vent/constructor.go:62 Going to send events to pod 'source-ztjipdjq' in namespace 'test-mamiqzxh'
2024-12-13T08:02:11.302Z info eventshub sender/sender.go:136 Sender environment configuration: {SenderName:source-ztjipdjq Sink:https://integrationsink-tjhtrpqo-deployment.test-mamiqzxh.svc.cluster.local CACerts:-----BEGIN CERTIFICATE-----
MIIBcDCCARagAwIBAgIQaWjf2VRD9t/Fi6ATOdG8QTAKBggqhkjOPQQDAjAYMRYw
FAYDVQQDEw1zZWxmc2lnbmVkLWNhMB4XDTI0MTIxMzA3NTcyOVoXDTI1MDMxMzA3
NTcyOVowGDEWMBQGA1UEAxMNc2VsZnNpZ25lZC1jYTBZMBMGByqGSM49AgEGCCqG
SM49AwEHA0IABMeWtNpAlfwKp0Jzd9yiOkBelJWlwFskfF52b1VR/iaM9pga8rnF
iFy1F/XvbPrXzmuRrTf1T+31rEQXabMhqmCjQjBAMA4GA1UdDwEB/wQEAwICpDAP
BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRttNHJSHwHtlokJUnveLVKbNHvQjAK
BggqhkjOPQQDAgNIADBFAiEAqmNQ4zCtRQikQLKMd4lhsJ7fNstEI3tuGPFdjUzf
vPUCIHRa/BOhBeHyL+0QGoZJZUIcjU2yTbtDLkNW1EDYacu3
-----END CERTIFICATE-----
EnforceTLS:true EnableOIDCAuth:false Delay:5 ProbeSink:true ProbeSinkTimeout:60 InputYAML:[] InputEvent:{"specversion":"1.0","id":"full-event","source":"http://example.com/source","type":"com.example.FullEvent","subject":"topic","datacontenttype":"text/json","dataschema":"http://example.com/schema","time":"2020-03-21T12:34:56.78Z","data":"hello","exstring":"exstring","exbinary":"AAECAw==","exurl":"http://example.com/source","extime":"2020-03-21T12:34:56.78Z","exbool":true,"exint":42} EventEncoding:binary InputHeaders:map[] InputBody: InputMethod:POST AddSequence:true IncrementalId:false OverrideTime:false Period:1 MaxMessages:2 SystemNamespace:test-mamiqzxh baseEvent:0xc00067c900 sequence:0 eventQueue:[]}
2024-12-13T08:02:11.302Z info eventshub sender/sender.go:149 will sleep for 5s
2024-12-13T08:02:16.303Z info eventshub sender/sender.go:151 awake, continuing
2024-12-13T08:02:46.309Z error eventshub sender/sender.go:181 {error 26 0 Head "https://integrationsink-tjhtrpqo-deployment.test-mamiqzxh.svc.cluster.local": dial tcp 10.106.242.10:443: i/o timeout}
knative.dev/reconciler-test/pkg/eventshub/sender.Start.func1
knative.dev/reconciler-test@v0.0.0-20241106013737-0619dc3ecbcf/pkg/eventshub/sender/sender.go:181
k8s.io/apimachinery/pkg/util/wait.PollImmediate.ConditionFunc.WithContext.func1
k8s.io/apimachinery@v0.30.3/pkg/util/wait/wait.go:109
k8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext
...
```

The log of the container looks like:

```
➜ eventing git:(integration_certmanager) ✗ stern -A integrationsink
+ test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb › sink
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink INFO exec -a "java" java -XX:MaxRAMPercentage=80.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+ExitOnOutOfMemoryError -Djava.util.logging.manager=org.jboss.logmanager.LogManager -cp "." -jar /home/jboss/quarkus-run.jar
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink INFO running in /home/jboss
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink __ ____ __ _____ ___ __ ____ ______
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink --\___\_\____/_/ |_/_/|_/_/|_|\____/___/
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,261 WARN [io.qua.config] (main) Unrecognized configuration key "quarkus.camel.openapi.codegen.model-package" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,573 INFO [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Apache Camel Quarkus 3.17.0 is starting
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,574 INFO [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.9.0 is starting
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,655 INFO [org.apa.cam.mai.BaseMainSupport] (main) Auto-configuration summary
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,656 INFO [org.apa.cam.mai.BaseMainSupport] (main) [MicroProfilePropertiesSource] camel.main.routesIncludePattern = camel/sink.yaml
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,656 INFO [org.apa.cam.mai.BaseMainSupport] (main) [MicroProfilePropertiesSource] camel.component.knative.environmentPath = classpath:knative.json
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,894 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.9.0 (camel-1) is starting
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,900 INFO [org.apa.cam.mai.BaseMainSupport] (main) Property-placeholders summary
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,900 INFO [org.apa.cam.mai.BaseMainSupport] (main) [log-sink.kamelet.yaml] showHeaders = true
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,901 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes startup (total:1 started:1 kamelets:1)
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,901 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Started log-sink (knative://event/)
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,901 INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.9.0 (camel-1) started in 7ms (build:0ms init:0ms start:7ms boot:618ms)
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,967 INFO [io.quarkus] (main) log-sink 1.0-SNAPSHOT on JVM (powered by Quarkus 3.17.0) started in 0.940s. Listening on: http://0.0.0.0:8080
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,967 INFO [io.quarkus] (main) Profile prod activated.
test-mamiqzxh integrationsink-tjhtrpqo-deployment-78ddd9c966-g2kkb sink 2024-12-13 08:01:56,968 INFO [io.quarkus] (main) Installed features: [camel-attachments, camel-cloudevents, camel-core, camel-kamelet, camel-knative, camel-knative-producer, camel-log, camel-microprofile-health, camel-platform-http, camel-yaml-dsl, cdi, kubernetes, smallrye-context-propagation, smallrye-health, vertx]
```

and the deployment for it is like:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
creationTimestamp: "2024-12-13T08:01:39Z"
generation: 1
labels:
app.kubernetes.io/name: integrationsink-tjhtrpqo
name: integrationsink-tjhtrpqo-deployment
namespace: test-mamiqzxh
ownerReferences:
- apiVersion: sinks.knative.dev/v1alpha1
blockOwnerDeletion: true
controller: true
kind: IntegrationSink
name: integrationsink-tjhtrpqo
uid: 1641dbc0-9f57-4544-aeb5-2e2e6517cb5a
resourceVersion: "3036"
uid: a29c32a4-7680-4080-84ba-13307f9eb3ff
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/name: integrationsink-tjhtrpqo
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: integrationsink-tjhtrpqo
spec:
containers:
- env:
- name: CAMEL_KAMELET_LOG_SINK_LOGGERNAME
value: log-sink
- name: CAMEL_KAMELET_LOG_SINK_LEVEL
value: INFO
- name: CAMEL_KAMELET_LOG_SINK_LOGMASK
value: "false"
- name: CAMEL_KAMELET_LOG_SINK_MULTILINE
value: "false"
- name: CAMEL_KAMELET_LOG_SINK_SHOWALLPROPERTIES
value: "false"
- name: CAMEL_KAMELET_LOG_SINK_SHOWBODY
value: "true"
- name: CAMEL_KAMELET_LOG_SINK_SHOWBODYTYPE
value: "true"
- name: CAMEL_KAMELET_LOG_SINK_SHOWEXCHANGEPATTERN
value: "true"
- name: CAMEL_KAMELET_LOG_SINK_SHOWHEADERS
value: "true"
- name: CAMEL_KAMELET_LOG_SINK_SHOWPROPERTIES
value: "false"
- name: CAMEL_KAMELET_LOG_SINK_SHOWSTREAMS
value: "false"
- name: CAMEL_KAMELET_LOG_SINK_SHOWCACHEDSTREAMS
value: "true"
image: gcr.io/knative-nightly/log-sink:latest
imagePullPolicy: IfNotPresent
name: sink
ports:
- containerPort: 8080
name: http
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1

```

Contributor guide

Open the contributing guide

Research direction

Start by comparing the sender configuration in eventshub/sender/sender.go with the generated IntegrationSink Deployment and its container port. Inspect camel/sink.yaml and log-sink.kamelet.yaml, then reproduce the TLS test while checking whether the HTTPS endpoint is reachable and serving TLS. Done means the TLS-enabled IntegrationSink accepts events without the sender timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, java, kubernetes
Domain
backend, devops, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.