Apicurio-studio: KubernetesでAPIEditの接続が倱われたした

䜜成日 2020幎06月07日  Â·  29コメント  Â·  ゜ヌス: Apicurio/apicurio-studio

こんにちは、Ingressを介しおWSを公開しおいるKubernetesで実行しようずするず、813で説明した問題ず同様の問題が発生したす。

WebSocket connection to 'ws://apicurio-ws.192.168.1.5.nip.io/ws/designs/2?uuid=68064b1e-f839-4973-b65e-89660d4a07d9&user=admin&secret=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJxRV9
COWQ4NFZS' failed: Error during WebSocket handshake: Unexpected response code: 404

distro / kubernetesでkubernetesマニフェストファむルを䜿甚しおいたす。 すべおのサヌビスのホストを倉曎するだけです。

最も参考になるコメント

玠晎らしいニュヌス これらの倉曎には別のPRが必芁だず思いたすか @ t-rapず@jsenkoはどう思いたすか

党おのコメント29件

813の情報は圹に立たなかったず思いたすか これは同じ問題のように芋えたす。 たぶん@ 0x218は圌らのむンストヌルのために働いた倉曎に぀いお詳しく説明するこずができたすか たたは、おそらく@ t-rapにはいく぀かの考えがありたすか 私のkubernetesの専門知識は非垞に限られおいたす。

はい、提案されたNginx Ingress @ 0x218のVersion、Upgrade、Connectionヘッダヌを適甚しおみたした。 それでも、Web゜ケットに接続できたせんでした。

問題をさらに理解するために提䟛できるログはありたすか

-wsポッドから「完党な」ブラりザコン゜ヌル出力ずサヌバヌログを提䟛できる堎合は、それが圹立぀可胜性がありたす。

ブラりザログ

[ApiEditorPageComponent] Attempting to reconnect to the server.
main.a117148be57ecc117ff5.js:1 [ApisService] Getting an API Design: http://apicurio.192.168.1.5.nip.io/studio-api/designs/2
main.a117148be57ecc117ff5.js:1 [ApisService] Editing API Design: http://apicurio.192.168.1.5.nip.io/studio-api/designs/2/session
main.a117148be57ecc117ff5.js:1 [ApisService] Editing Session UUID: 0d50ffc8-1f69-41b0-b1f0-6c80a1771e00
main.a117148be57ecc117ff5.js:1 [ApisService] Content Version: 3
main.a117148be57ecc117ff5.js:1 [ApiEditorPageComponent] Definition loaded.  Opening editing session.
main.a117148be57ecc117ff5.js:1 [ApisService] Opening editing session on URL: ws://apicurio-ws.192.168.1.5.nip.io/ws/designs/2?uuid=0d50ffc8-1f69-41b0-b1f0-6c80a1771e00&user=admin&secret=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCNlRDTFAxdkIz
main.a117148be57ecc117ff5.js:1 WebSocket connection to 'ws://apicurio-ws.192.168.1.5.nip.io/ws/designs/2?uuid=0d50ffc8-1f69-41b0-b1f0-6c80a1771e00&user=admin&secret=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCNlRDTFAxdkIz' failed: Error during WebSocket handshake: Unexpected response code: 404
t.openEditingSession @ main.a117148be57ecc117ff5.js:1
(anonymous) @ main.a117148be57ecc117ff5.js:1
e.invoke @ polyfills.9c67d1be23abf75fea1a.js:1
onInvoke @ main.a117148be57ecc117ff5.js:1
e.invoke @ polyfills.9c67d1be23abf75fea1a.js:1
t.run @ polyfills.9c67d1be23abf75fea1a.js:1
(anonymous) @ polyfills.9c67d1be23abf75fea1a.js:1
e.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
onInvokeTask @ main.a117148be57ecc117ff5.js:1
e.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
t.runTask @ polyfills.9c67d1be23abf75fea1a.js:1
y @ polyfills.9c67d1be23abf75fea1a.js:1
t.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
_ @ polyfills.9c67d1be23abf75fea1a.js:1
m @ polyfills.9c67d1be23abf75fea1a.js:1
main.a117148be57ecc117ff5.js:1 [ApiEditingSession] WS connection to server CLOSED: CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", 
}
main.a117148be57ecc117ff5.js:1 [ApiEditorPageComponent] **Notice** editing session DROPPED!  Reason code: 1006
main.a117148be57ecc117ff5.js:1 [ApiEditorPageComponent] Attempting to reconnect to the server.
main.a117148be57ecc117ff5.js:1 [ApisService] Getting an API Design: http://apicurio.192.168.1.5.nip.io/studio-api/designs/2
main.a117148be57ecc117ff5.js:1 [ApisService] Editing API Design: http://apicurio.192.168.1.5.nip.io/studio-api/designs/2/session
main.a117148be57ecc117ff5.js:1 [ApisService] Editing Session UUID: 5eecf1e6-2a83-4940-bdb0-110240374093
main.a117148be57ecc117ff5.js:1 [ApisService] Content Version: 3
main.a117148be57ecc117ff5.js:1 [ApiEditorPageComponent] Definition loaded.  Opening editing session.
main.a117148be57ecc117ff5.js:1 [ApisService] Opening editing session on URL: ws://apicurio-ws.192.168.1.5.nip.io/ws/designs/2?uuid=5eecf1e6-2a83-4940-bdb0-110240374093&user=admin&secret=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCNlRDTFAxdkIz
main.a117148be57ecc117ff5.js:1 WebSocket connection to 'ws://apicurio-ws.192.168.1.5.nip.io/ws/designs/2?uuid=5eecf1e6-2a83-4940-bdb0-110240374093&user=admin&secret=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJCNlRDTFAxdkIz' failed: Error during WebSocket handshake: Unexpected response code: 404
t.openEditingSession @ main.a117148be57ecc117ff5.js:1
(anonymous) @ main.a117148be57ecc117ff5.js:1
e.invoke @ polyfills.9c67d1be23abf75fea1a.js:1
onInvoke @ main.a117148be57ecc117ff5.js:1
e.invoke @ polyfills.9c67d1be23abf75fea1a.js:1
t.run @ polyfills.9c67d1be23abf75fea1a.js:1
(anonymous) @ polyfills.9c67d1be23abf75fea1a.js:1
e.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
onInvokeTask @ main.a117148be57ecc117ff5.js:1
e.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
t.runTask @ polyfills.9c67d1be23abf75fea1a.js:1
y @ polyfills.9c67d1be23abf75fea1a.js:1
t.invokeTask @ polyfills.9c67d1be23abf75fea1a.js:1
_ @ polyfills.9c67d1be23abf75fea1a.js:1
m @ polyfills.9c67d1be23abf75fea1a.js:1
main.a117148be57ecc117ff5.js:1 [ApiEditingSession] WS connection to server CLOSED: CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", 
}
main.a117148be57ecc117ff5.js:1 [ApiEditorPageComponent] **Notice** editing session DROPPED!  Reason code: 1006

wsポッドの完党なログ

06-10 14:46:08,780 DEBUG [io.undertow.request.security] (default task-1) Authentication result was ATTEMPTED for /ws/designs/2
2020-06-10 14:46:08,781 DEBUG [io.undertow.request] (default task-1) Matched default handler path /ws/designs/2
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread Status <== SCANNING
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread scanning
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Periodic recovery first pass at Wed, 10 Jun 2020 14:46:11
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction transactions
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule<strong i="6">@7e04aa62</strong>' first pass processed
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) AtomicActionRecoveryModule first pass
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction transactions
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule<strong i="7">@3b062bc6</strong>' first pass processed
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.txoj] (Periodic Recovery) TORecoveryModule - first pass
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.txoj.recovery.TORecoveryModule<strong i="8">@29e089e5</strong>' first pass processed
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule<strong i="9">@5f676b11</strong>' first pass processed
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change IDLE->FIRST_PASS

2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) Local XARecoveryModule - first pass
2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change FIRST_PASS->BETWEEN_PASSES

2020-06-10 14:46:11,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule<strong i="10">@5ad9faef</strong>' first pass processed
2020-06-10 14:46:20,674 DEBUG [io.undertow.request] (default I/O-2) Matched default handler path /ws/designs/2
2020-06-10 14:46:20,675 DEBUG [io.undertow.request.security] (default task-1) Attempting to authenticate /ws/designs/2, authentication required: false
2020-06-10 14:46:20,675 DEBUG [io.undertow.request.security] (default task-1) Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.CachedAuthenticatedSessionMechanism<strong i="11">@59a16760</strong> for /ws/designs/2
2020-06-10 14:46:20,675 DEBUG [io.undertow.request.security] (default task-1) Authentication result was ATTEMPTED for /ws/designs/2
2020-06-10 14:46:20,675 DEBUG [io.undertow.request] (default task-1) Matched default handler path /ws/designs/2
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Periodic recovery second pass at Wed, 10 Jun 2020 14:46:21
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule<strong i="12">@7e04aa62</strong>' second pass processed
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) AtomicActionRecoveryModule second pass
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule<strong i="13">@3b062bc6</strong>' second pass processed
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.txoj] (Periodic Recovery) TORecoveryModule - second pass
2020-06-10 14:46:21,291 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.txoj.recovery.TORecoveryModule<strong i="14">@29e089e5</strong>' second pass processed
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule<strong i="15">@5f676b11</strong>' second pass processed
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change BETWEEN_PASSES->SECOND_PASS

2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) Local XARecoveryModule - second pass
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) Local XARecoveryModule.transactionInitiatedRecovery completed
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) Local XARecoveryModule.resourceInitiatedRecovery completed
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change SECOND_PASS->IDLE

2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule<strong i="16">@5ad9faef</strong>' second pass processed
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread Status <== INACTIVE
2020-06-10 14:46:21,292 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread backing off

男私はそれでは、䜕がうたくいかないのか分かりたせん。 -wsポッドず-apiポッドが同じデヌタベヌスに接続されおいるこずを確認しおください。 そうでない堎合は接続゚ラヌが発生したすが、その堎合は-wsポッドログに゚ラヌが衚瀺され、404は発生しないず思いたす。

ある皮のIngressの問題であるに違いないようですが、k8sに぀いお十分な知識がありたせん。 :(

たた、NodePortを介しおwsポッドを盎接公開しようずしたした。 それでも私はただ成功したせんでした。

もう䞀床やり盎したす。 ログレベルを䞊げるこずは圹に立ちたすか

痛くはありたせんでした。 -wsコンポヌネントでは認蚌が有効になっおいないため、-wsログに認蚌に関する䜕かがありたしたが、私にはよくわかりたせんでした。 たぶん、ログレベルを䞊げるず、それがさらに明らかになるでしょう。

ログレベルをどのレベルに䞊げる必芁があるず思いたすか

おそらくDEBUGから始めお、䜕が起こるかを芋おください。 :)

デバッグするログレベルを増やしたした。 しかし、有益なログはありたせん。

ws

cloak.adapters.OAuthRequestAuthenticator] (default task-2) there was no code
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-2) redirecting to auth server
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.undertow.ServletSessionTokenStore] (default task-3) session was null, returning null
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-3) there was no code
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-3) redirecting to auth server
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-2) callback uri: http://apicurio-studio-ui.192.168.1.5.nip.io/version.js
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-3) callback uri: http://apicurio-studio-ui.192.168.1.5.nip.io/config.js
2020-06-13 22:20:10,628 DEBUG [io.undertow.request.security] (default task-2) Authentication outcome was NOT_ATTEMPTED with method org.keycloak.adapters.wildfly.WildflyAuthenticationMechanism<strong i="7">@26c8577b</strong> for /version.js
2020-06-13 22:20:10,628 DEBUG [io.undertow.request.security] (default task-2) Authentication result was ATTEMPTED for /version.js
2020-06-13 22:20:10,628 DEBUG [io.undertow.request.security] (default task-3) Authentication outcome was NOT_ATTEMPTED with method org.keycloak.adapters.wildfly.WildflyAuthenticationMechanism<strong i="8">@26c8577b</strong> for /config.js
2020-06-13 22:20:10,628 DEBUG [io.undertow.request.security] (default task-3) Sending authentication challenge for HttpServerExchange{ GET /config.js}
2020-06-13 22:20:10,628 DEBUG [io.undertow.request] (default task-2) Matched default handler path /version.js
2020-06-13 22:20:10,628 DEBUG [org.keycloak.adapters.AuthenticatedActionsHandler] (default task-2) AuthenticatedActionsValve.invoke http://apicurio-studio-ui.192.168.1.5.nip.io/version.js
2020-06-13 22:20:10,629 DEBUG [org.keycloak.adapters.AuthenticatedActionsHandler] (default task-2) Policy enforcement is disabled.
2020-06-13 22:20:10,629 DEBUG [io.undertow.session] (default task-3) Created session with id oIOfXf1RPvC2PBpI4dTuVZKYk7f8BDg0XUAFHWrC for exchange HttpServerExchange{ GET /config.js}
2020-06-13 22:20:10,629 DEBUG [org.keycloak.adapters.OAuthRequestAuthenticator] (default task-3) Sending redirect to login page: http://keycloak-microcks.192.168.1.5.nip.io/auth/realms/Apicurio/protocol/openid-connect/auth?response_type=code&client_id=apicurio-studio&redirect_uri=http%3A%2F%2Fapicurio-studio-ui.192.168.1.5.nip.io%2Fconfig.js&state=3e4e092e-bc54-4802-a517-d3462de6f343&login=true&scope=openid
2020-06-13 22:20:10,629 DEBUG [io.undertow.request.security] (default task-3) Authentication result was CHALLENGE_SENT for /config.js
2020-06-13 22:21:00,918 DEBUG [io.undertow.request] (default I/O-2) Timing out idle connection from /10.1.94.1:41180
2020-06-13 22:21:00,918 DEBUG [io.undertow.request] (default I/O-2) Timing out idle connection from /10.1.94.1:41178
2020-06-13 22:21:48,749 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread Status <== SCANNING
2020-06-13 22:21:48,749 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) PeriodicRecovery: background thread scanning
2020-06-13 22:21:48,749 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Periodic recovery first pass at Sat, 13 Jun 2020 22:21:48
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction transactions
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule<strong i="9">@3bc2db45</strong>' first pass processed
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) AtomicActionRecoveryModule first pass
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction transactions
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule<strong i="10">@7ec04259</strong>' first pass processed
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.txoj] (Periodic Recovery) TORecoveryModule - first pass
2020-06-13 22:21:48,750 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.txoj.recovery.TORecoveryModule<strong i="11">@1a9ffeac</strong>' first pass processed
2020-06-13 22:21:48,751 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule<strong i="12">@1aa1c748</strong>' first pass processed
2020-06-13 22:21:48,751 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change IDLE->FIRST_PASS

2020-06-13 22:21:48,751 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) Local XARecoveryModule - first pass
2020-06-13 22:21:48,751 DEBUG [com.arjuna.ats.jta] (Periodic Recovery) XARecoveryModule state change FIRST_PASS->BETWEEN_PASSES

2020-06-13 22:21:48,751 DEBUG [com.arjuna.ats.arjuna] (Periodic Recovery) Recovery module 'com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule<strong i="13">@5b07f3c7</strong>' first pass processed

しかし、問題を説明しおいる可胜性のあるブラりザログに気づきたした。

main.a117148
.js:1 [ApiEditingSession] WS connection to server CLOSED: 
CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", 
}
bubbles: false
cancelBubble: false
cancelable: false
code: 1006
composed: false
currentTarget: WebSocket {__zone_symbol__openfalse: Array(1), __zone_symbol__messagefalse: Array(1), __zone_symbol__ON_PROPERTYopen: ƒ, __zone_symbol__ON_PROPERTYmessage: ƒ, __zone_symbol__ON_PROPERTYclose: ƒ, 
}
defaultPrevented: false
eventPhase: 0
isTrusted: true
path: []
reason: ""
returnValue: true
srcElement: WebSocket {__zone_symbol__openfalse: Array(1), __zone_symbol__messagefalse: Array(1), __zone_symbol__ON_PROPERTYopen: ƒ, __zone_symbol__ON_PROPERTYmessage: ƒ, __zone_symbol__ON_PROPERTYclose: ƒ, 
}
target: WebSocket {__zone_symbol__openfalse: Array(1), __zone_symbol__messagefalse: Array(1), __zone_symbol__ON_PROPERTYopen: ƒ, __zone_symbol__ON_PROPERTYmessage: ƒ, __zone_symbol__ON_PROPERTYclose: ƒ, 
}
timeStamp: 1177278.1400000094
type: "close"
wasClean: false
__proto__: CloseEvent

Web゜ケットシヌズンぱラヌコヌド1006で終了しおいたす

含めたサヌバヌログは、実際には-uiポッドのログであり、 -wsポッドのログではありたせん。

゚ラヌコヌド1006は、Web゜ケットがブラりザによっお異垞に閉じられたこずを意味したす。 :(そしお悲しいこずに、ブラりザはおそらくあなたに理由を䞎えないでしょう。ここにいく぀かの情報がありたす

https://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed-with-close-code-1006

おそらく詊すこずができるのは、ある皮のWebSocketテストツヌルを芋぀けおそれを䜿おうずするこずです。 䜿甚できる蚺断情報が埗られる堎合がありたす。

次のコマンドで取埗されたログ

kubectl logs apicurio-studio-ws-7c458cf8d8-cgscc

怜玢できる特定のログはありたすか

Web゜ケットをテストするための掚奚事項はありたすか

https://websocket.org/echo.htmlを介しおWeb゜ケットをテストする方法を芋぀けたした。

ws接続コヌドをコンピュヌタヌにコピヌしたした。 どのようなメッセヌゞを送信する必芁がありたすか

䞊蚘で投皿した出力には、keycloak認蚌リダむレクトやその他のkeycloak関連の出力、およびconfig.jsずversion.jsのリク゚ストが明確に瀺されおいるため、これは本圓に奇劙なこずです。これらはすべおUIが行うこずです。 WebSocketコンポヌネントには、Keycloakがたったく含たれおいたせん。 3぀のポッドすべおからログ出力を取埗できたすか それは面癜いでしょう。 おそらく、ポッドに実際に問題がありたす

Web゜ケットのテストに぀いお。 接続しおみお、䜕が起こるかを確認しおください。 それが機胜しおいる堎合は、次のようなものを取埗する必芁がありたす。

image

「接続」段階で接続が切断された堎合、その最初の接続はおそらく倱敗したす。

websocket.orgで提䟛されおいるコヌドをコピヌしおwebsocketをテストし、ハヌドドラむブにwebsocket.htmlずしお保存しお、ロヌカルネットワヌクでwsポッドをテストしたした。 残念ながら、ロヌカルネットワヌクのwsに接続できたせんでした。 ただし、パブリックWebSocketを接続するこずはできたした
wss://studio-ws.apicur.io/designs 。 したがっお、WebSocketテストは実行可胜であるず思いたす。

添付ファむルにすべおのログを提䟛したした

kubectlログapicurio-studio-ui-5c6f5df485-lcdxp> apicurio-studio-ui.log
kubectlログapicurio-studio-ws-77dc7f7b87-57dcs> apicurio-studio-ws.log
kubectlログapicurio-studio-api-79d9d799cb-mgsmx> apicurio-studio-api.log

apicurio-studio-api.log
apicurio-studio-ui.log
apicurio-studio-ws.log

私は぀いにそれを機胜させたした NodePortを介しおwsポッドを盎接公開したした。 問題は入力構成にあるず確信しおいたす。

玠晎らしい これを抌し進めおくれおありがずうあきらめないで。 そしお申し蚳ありたせんが、私はこれ以䞊の助けになるこずができたせんでした。 私のkubernetesの知識レベルは䜎いです。 動䜜させるために远加する必芁のあるYAML構成を投皿できたすか 最終的にはApicurioStudioのオペレヌタヌを䜜成する予定ですが、それがい぀発生するかは正確にはわかりたせん。

正盎なずころ、私は特定のyaml構成を䜜成したせんでした。

NodePortサヌビスを䜜成したす。これは、ws pods8080ポヌトがランダムポヌトのマシンIPに公開されるこずを意味したす。

これが私がNodePortを䜜成した方法です
kubectl expose deployment apicurio-studio-ws --type NodePort --name test

これにより、マシンIP32204を介しおアクセスできる32204のランダムポヌトが埗られたした。

kubectl get svc

NAME                           TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
test                           NodePort    10.152.183.2     <none>        8080:32204/TCP   10h

NodePortポヌトはランダムであり、 apicurio-configmap.yamlで事前に構成できないため、ingresnginxがWebSocketを公開するための掚奚される方法であるず私はただ考えおいたす。

私の堎合はどちらですか

apicurio-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: apicurio-configmap
data:
  apicurio-db-connection-url: jdbc:mysql://apicuriodb:3306/apicuriodb
  apicurio-kc-client-id: apicurio-studio
  apicurio-kc-realm: Apicurio
  apicurio-microcks-api-url: http://microcks-microcks.192.168.1.5.nip.io/api
  apicurio-microcks-client-id: microcks-serviceaccount
  apicurio-ui-editing-url: ws://192.168.1.5:32204/
  apicurio-ui-feature-microcks: "true"
  apicurio-ui-feature-share-with-everyone: "true"
  apicurio-ui-hub-api-url: http://apicurio.192.168.1.5.nip.io/studio-api
  apicurio-ui-logout-redirect-uri: /
  keycloak-url: http://keycloak-microcks.192.168.1.5.nip.io/auth

OK、ずおも興味深い。 なぜnginxアプロヌチがうたくいかなかったのか分かりたせん。 :(しかし、䜕かが機胜しおくれおうれしいです

入力を介しおwsポッドを公開する方法を芋぀けたした。 この゜リュヌションは、はるかに構成可胜です。

Screen Shot 2020-06-19 at 1 40 21 AM

この゜リュヌションでは、入力を介しおWSポッド甚に別のURLを䜜成したした。

評䟡甚のPRを提䟛したす。

ねえ、パヌティヌに遅れおすみたせん。

@cemnuraどのむングレスを䜿甚しおいお、どのバヌゞョンで䜿甚しおいたすか

nginx-ingress-controllerを䜿甚する堎合は、倚くの修正ず倉曎が加えられおいたす。

それに぀いお奇劙なこずの1぀は、特にhttp / httpsを切り替えようずしたずきのWebSocketの動䜜です。

@EricWittmann必芁に応じお、パッチが適甚されたバヌゞョンが機胜するかどうかをテストできたすnginx-ingress-バヌゞョンが最新のものに曎新されたす。

あなたが提䟛できるどんな助けでもありがたいです、@ t-rap

Helllo @ t-rap私が理解しおいる限り、 nginx-ingress-controller-amd64を䜿甚するmicrok8sKubernetesを実行しおいたす。

Name:         nginx-ingress-microk8s-controller-nd8vb
Namespace:    ingress
Priority:     0
Node:         mccloud/192.168.1.5
Start Time:   Tue, 02 Jun 2020 23:12:28 +0300
Labels:       controller-revision-hash=59cb5dd586
              name=nginx-ingress-microk8s
              pod-template-generation=1
Annotations:  <none>
Status:       Running
IP:           192.168.1.5
IPs:
  IP:           192.168.1.5
Controlled By:  DaemonSet/nginx-ingress-microk8s-controller
Containers:
  nginx-ingress-microk8s:
    Container ID:  containerd://3219d168e8fbb190acd214ab651f781f6adf51adcc2302891636a5ff250ef15f
    Image:         quay.io/kubernetes-ingress-controller/nginx-ingress-controller-amd64:0.25.1
    Image ID:      sha256:2b8ed1f2046d4b37c18cca2ecc4f435b6618d2d198c0c8bf617954e863cc5832
    Ports:         80/TCP, 443/TCP
    Host Ports:    80/TCP, 443/TCP
    Args:
      /nginx-ingress-controller
      --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf
      --publish-status-address=127.0.0.1
    State:          Running
      Started:      Fri, 12 Jun 2020 15:08:07 +0300
    Last State:     Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Wed, 10 Jun 2020 23:37:02 +0300
      Finished:     Fri, 12 Jun 2020 15:08:03 +0300
    Ready:          True
    Restart Count:  187
    Liveness:       http-get http://:10254/healthz delay=30s timeout=5s period=10s #success=1 #failure=3
    Environment:
      POD_NAME:       nginx-ingress-microk8s-controller-nd8vb (v1:metadata.name)
      POD_NAMESPACE:  ingress (v1:metadata.namespace)
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from nginx-ingress-microk8s-serviceaccount-token-r6md6 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  nginx-ingress-microk8s-serviceaccount-token-r6md6:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  nginx-ingress-microk8s-serviceaccount-token-r6md6
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/network-unavailable:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute
                 node.kubernetes.io/pid-pressure:NoSchedule
                 node.kubernetes.io/unreachable:NoExecute
                 node.kubernetes.io/unschedulable:NoSchedule
Events:          <none>

どうもありがずうございたした@cemnura
私が䜜ったフォヌクをテストできたすか以䞋を参照 事前にもう䞀床ありがずう:)

https://github.com/t-rap/apicurio-studio-981/でingress-nginx-controllerバヌゞョン0.24.1ずapicurio-studio0.2.44.Finalを䜿甚しお構成をテストしたした
サブパス「/ designs」をingressapicurio-studio-wsに远加したした。これは、wsで凊理する必芁があるサブパスであるためです。

ingress-controller0.25.1ずapicurio-studio0.2.46でいく぀かのテストを実行したす。最終的にはおそらく週末になりたす。
入力コントロヌラヌはkubernetesによっお管理されおいるため、認識すべき倉曎がたくさんありたす。

もう必芁ないので、構成スニペットも削陀したした私の悪い、圓たり前

終わったら曎新したす。

@ t-rapを詊しおみたす👍

提䟛されおいるKubernetesマニフェスト@ t-rapを䜿甚しお、 uiポッドず同じURLでwsポッドを公開するこずができたした。

ただし、いく぀かの小さな倉曎がありたす。

wspodの入力名をapicurio-studio-wsに倉曎したした

https://github.com/Apicurio/apicurio-studio/blob/17a8e6bc21cae5a90aebb1a7a0e64350aeb30f57/distro/kubernetes/apicurio-studio-ingresses.yaml#L38 -L41

apicurio-ui-editing-urlキヌのapicurio-configmap.yamlの/wsサフィックスを削陀したした

https://github.com/Apicurio/apicurio-studio/blob/17a8e6bc21cae5a90aebb1a7a0e64350aeb30f57/distro/kubernetes/apicurio-configmap.yaml#L9

apicurio-studio-ingresses.yamlの入力構成の/wsパスを削陀したした

これが私の構成です

apicurio-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: apicurio-configmap
data:
  apicurio-db-connection-url: jdbc:mysql://apicuriodb:3306/apicuriodb
  apicurio-kc-client-id: apicurio-studio
  apicurio-kc-realm: Apicurio
  apicurio-microcks-api-url: http://microcks-microcks.192.168.1.5.nip.io/api
  apicurio-microcks-client-id: microcks-serviceaccount
  apicurio-ui-editing-url: ws://apicurio.192.168.1.5.nip.io
  apicurio-ui-feature-microcks: "true"
  apicurio-ui-feature-share-with-everyone: "true"
  apicurio-ui-hub-api-url: http://apicurio.192.168.1.5.nip.io/studio-api
  apicurio-ui-logout-redirect-uri: /
  keycloak-url: http://keycloak-microcks.192.168.1.5.nip.io/auth

apicurio-studio-ingresses.yaml

kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: apicurio-studio-api
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  labels:
    module: apicurio-studio-api
spec:
  rules:
  - host: apicurio.192.168.1.5.nip.io
    http:
      paths:
      - backend:
          serviceName: "apicurio-studio-api"
          servicePort: 8091
        path: /studio-api/?(.*)
---
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: apicurio-studio-ui
  labels:
    module: apicurio-studio-ui
spec:
  rules:
    - host: apicurio.192.168.1.5.nip.io
      http:
        paths:
          - backend:
              serviceName: "apicurio-studio-ui"
              servicePort: 8093
            path: /
---
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: apicurio-studio-ws
  annotations:
  labels:
    module: apicurio-studio-ws
spec:
  rules:
    - host: apicurio.192.168.1.5.nip.io
      http:
        paths:
          - backend:
              serviceName: "apicurio-studio-ws"
              servicePort: 8092
            path: /designs

玠晎らしいニュヌス これらの倉曎には別のPRが必芁だず思いたすか @ t-rapず@jsenkoはどう思いたすか

このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡