Cannot bring up production on Kubernetes (OD-244)
Casper opened 5 years ago

Hi:

I try to deploy the onedev on the Kubernetes but got an error so that it cannot be bring up. Could you please have a check?

Installation path: k8s-resources/production

NAME STATUS ROLES AGE VERSION node1 Ready master 62d v1.19.5

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mysql ClusterIP 10.233.21.174 3306/TCP 5h7m onedev LoadBalancer 10.233.7.135 80:30748/TCP,22:32099/TCP 5h7m

NAME ENDPOINTS AGE mysql 10.233.90.253:3306 5h7m onedev 10.233.90.241:6611,10.233.90.241:6610 5h7m

--> Wrapper Started as Console Java Service Wrapper Standard Edition 64-bit 3.5.44 Copyright (C) 1999-2020 Tanuki Software, Ltd. All Rights Reserved. http://wrapper.tanukisoftware.com Licensed to OneDev for Service Wrapping

Launching a JVM... WrapperManager: Initializing... INFO - Launching application from '/app'... INFO - Initializing dependency injection container... INFO - Starting plugin manager... INFO - Upgrading /opt/onedev... INFO - >>> INFO - Launching application from '/opt/onedev'... INFO - >>> INFO - Cleaning temp directory... INFO - >>> INFO - Initializing dependency injection container... INFO - >>> INFO - Starting plugin manager... INFO - Old data version: 49 INFO - Backing up old program files as /opt/onedev/site/program-backup/2021-02-22_09-16-28... INFO - Copying new program files into /opt/onedev... INFO - Successfully upgraded /opt/onedev <-- Wrapper Stopped --> Wrapper Started as Console Java Service Wrapper Standard Edition 64-bit 3.5.44 Copyright (C) 1999-2020 Tanuki Software, Ltd. All Rights Reserved. http://wrapper.tanukisoftware.com Licensed to OneDev for Service Wrapping

Launching a JVM... WrapperManager: Initializing... 09:25:05 INFO i.o.c.launcher.bootstrap.Bootstrap - Launching application from '/opt/onedev'... 09:25:05 INFO i.o.c.launcher.bootstrap.Bootstrap - Cleaning temp directory... 09:25:05 INFO i.o.c.launcher.loader.AppLoader - Initializing dependency injection container... 09:25:07 INFO i.o.c.launcher.loader.AppLoader - Starting plugin manager... 09:25:14 ERROR i.o.c.launcher.bootstrap.Bootstrap - Error booting application java.lang.IllegalStateException: Cannot render this url in FULL mode because it does not have a host set. at org.apache.wicket.request.Url.toString(Url.java:740) ~[org.apache.wicket.wicket-request-7.17.0.jar:7. 17.0] at org.apache.wicket.request.Url.toString(Url.java:800) ~[org.apache.wicket.wicket-request-7.17.0.jar:7.17.0] at io.onedev.server.maintenance.DefaultDataManager.init(DefaultDataManager.java:142) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.persistence.TransactionInterceptor$1.call(TransactionInterceptor.java:23) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.persistence.DefaultTransactionManager$1.call(DefaultTransactionManager.java:72) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.persistence.DefaultSessionManager.call(DefaultSessionManager.java:79) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.persistence.DefaultTransactionManager.call(DefaultTransactionManager.java:60) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.persistence.TransactionInterceptor.invoke(TransactionInterceptor.java:18) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.server.OneDev.start(OneDev.java:113) ~[io.onedev.server-core-4.1.4.jar:na] at io.onedev.commons.launcher.loader.DefaultPluginManager.start(DefaultPluginManager.java:44) ~[io.onedev.commons-launcher-loader-2.0.2.jar:na] at io.onedev.commons.launcher.loader.AppLoader.start(AppLoader.java:74) ~[io.onedev.commons-launcher-loader-2.0.2.jar:na] at io.onedev.commons.launcher.bootstrap.Bootstrap.main(Bootstrap.java:165) ~[io.onedev.commons-launcher-bootstrap-2.0.2.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_282] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_282] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_282] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_282] at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349) [wrapper.jar:3.5.44] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_282] <-- Wrapper Stopped

  • Robin Shen commented 5 years ago

    Looks like OneDev is not able to determine the host name it is running on in the cluster. Can you please let me know how you created/configured the k8s cluster?

  • Casper commented 5 years ago

    Hi,

    The server is a standalone VM running on an physical server, no other workers. I think the onedev is running in a Pod, what's the hostname it need? like the K8s DNS format? onedev.onedev.svc.cluster.local?

    I am not clear which information you need, let me know the detail, thanks.

    BR//Casper

    ==cut== NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME node1 Ready master 63d v1.19.5 192.168.8.9 CentOS Linux 7 (Core) 3.10.0-957.27.2.el7.x86_64 docker://19.3.14

  • Robin Shen commented 5 years ago

    From what you've described, I understand that OneDev is deployed to a k8s cluster as a pod.

    Then you mentioned that the server is a standalone VM running on a physical server. Do you mean that your k8s cluster is a home-grown cluster running on that server, or OneDev itself is running out of k8s, but inside a docker container on that server?

  • Robin Shen commented 5 years ago

    Sorry know what you are meaning now. Will come up with some debug code to find out the problem.

  • Robin Shen commented 5 years ago

    What is the output of below command on your cluster?

    kubectl get service onedev -n onedev -o "jsonpath={.status.loadBalancer.ingress[0].ip}"
    
  • Robin Shen commented 5 years ago

    And also this command:

    kubectl get service onedev -n onedev -o "jsonpath={range .spec.ports[*]}{.name} {.port}{'\\n'}{end}"
    
  • Casper commented 5 years ago

    Got nothing from your command.

    kb get service onedev -n onedev -o "jsonpath={.status.loadBalancer.ingress[0].ip}"

    kb get svc/onedev -o yaml apiVersion: v1 kind: Service metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"app":"onedev","tier":"server"} ,"name":"onedev","namespace":"onedev"},"spec":{"ports":[{"name":"http","port":80,"protocol":"TCP","targetPort":6 610},{"name":"ssh","port":22,"protocol":"TCP","targetPort":6611}],"selector":{"app":"onedev","tier":"server"},"t ype":"LoadBalancer"}} creationTimestamp: "2021-02-22T04:14:36Z" labels: app: onedev tier: server managedFields:

    • apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:kubectl.kubernetes.io/last-applied-configuration: {} f:labels: .: {} f:app: {} f:tier: {} f:spec: f:externalTrafficPolicy: {} f:externalTrafficPolicy: {} f:ports: .: {} k:{"port":22,"protocol":"TCP"}: .: {} f:name: {} f:port: {} f:protocol: {} f:targetPort: {} k:{"port":80,"protocol":"TCP"}: .: {} f:name: {} f:port: {} f:protocol: {} f:targetPort: {} f:selector: .: {} f:app: {} f:tier: {} f:sessionAffinity: {} f:type: {} manager: kubectl-client-side-apply operation: Update time: "2021-02-22T04:14:36Z" name: onedev namespace: onedev resourceVersion: "17413113" selfLink: /api/v1/namespaces/onedev/services/onedev uid: 401f60a4-1199-400b-9bce-5d262a14455a spec: clusterIP: 10.233.7.135 externalTrafficPolicy: Cluster ports:
    • name: http nodePort: 30748 port: 80 protocol: TCP targetPort: 6610
    • name: ssh nodePort: 32099 port: 22 protocol: TCP targetPort: 6611 selector: app: onedev tier: server sessionAffinity: None type: LoadBalancer status: loadBalancer: {}

    kb get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mysql ClusterIP 10.233.21.174 3306/TCP 10h onedev LoadBalancer 10.233.7.135 80:30748/TCP,22:32099/TCP 10h

  • Casper commented 5 years ago
    > kb get service onedev -n onedev -o "jsonpath={range .spec.ports[*]}{.name} {.port}{'\\n'}{end}"
    http 80
    ssh 22
    
  • OneDev changed state to 'Closed' 5 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev changed state to 'Released' 5 years ago
    Previous Value Current Value
    Closed
    Released
  • Robin Shen commented 5 years ago

    This issue has been fixed in 4.1.5. Now OneDev will start fine even if no external ip is assigned. Since your k8s cluster does not assign external ip for the service, I'd suggest to modify file "base/services.yaml" to use "NodePort" instead of "LoadBalancer" for service type. This way, you will be able to access OneDev web GUi with node ip and assigned node port. You should also configure server url in OneDev setup page to reflect this ip/port so that spawned build jobs can connect to OneDev server via this url.

  • Casper commented 5 years ago

    Thanks for you quick fix. 👍 Actually, I were set the node port to expose the Onedev service, but it looked like whatever I configured, there were no status message show up. But anyway, I will try the new version. BR//Casper

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Issue Votes (1)
Watchers (3)
Reference
OD-244
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover