1
votes

I followed the installation steps using kubectl as given on http://docs.spring.io/spring-cloud-dataflow-server-kubernetes/docs/current-SNAPSHOT/reference/htmlsingle/.

While MySQL/ Redis/Metrics Collector deploy and run fine, when deploying scdf-server, I get an exception, with only the following stacktrace in logs. I couldn't find any certificate/fabric8 related configuration in documentation, any suggestions if I've missed something?

Kubernetes cluster = v1.9.2

scdf-kubernetes = latest snapshot

Logs:

16:30:28.362 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client from Kubernetes config...
16:30:28.374 [main] DEBUG io.fabric8.kubernetes.client.Config - Did not find Kubernetes config at: [/root/.kube/config]. Ignoring.
16:30:28.374 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client from service account...
16:30:28.375 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account ca cert at: [/var/run/secrets/kubernetes.io/serviceaccount/ca.crt].
16:30:28.452 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account token at: [/var/run/secrets/kubernetes.io/serviceaccount/token].
16:30:28.452 [main] DEBUG io.fabric8.kubernetes.client.Config - Trying to configure client namespace from Kubernetes service account namespace path...
16:30:28.452 [main] DEBUG io.fabric8.kubernetes.client.Config - Found service account namespace at: [/var/run/secrets/kubernetes.io/serviceaccount/namespace].
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.cloud.kubernetes.profile.KubernetesApplicationContextInitializer
        at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:413)
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:392)
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:383)
        at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:249)
        at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:225)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
        at org.springframework.cloud.dataflow.server.kubernetes.KubernetesDataFlowServer.main(KubernetesDataFlowServer.java:33)
        ... 8 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.kubernetes.profile.KubernetesApplicationContextInitializer]: Constructor threw exception; nested exception is io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
        at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:409)
        ... 15 more
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
        at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:62)
        at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:53)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:168)
        at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:55)
        at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:47)
        at io.fabric8.kubernetes.client.DefaultKubernetesClient.<init>(DefaultKubernetesClient.java:70)
        at org.springframework.cloud.kubernetes.profile.KubernetesApplicationContextInitializer.<init>(KubernetesApplicationContextInitializer.java:35)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
        ... 16 more
Caused by: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input
        at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:110)
        at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
        at io.fabric8.kubernetes.client.internal.CertUtils.createTrustStore(CertUtils.java:93)
        at io.fabric8.kubernetes.client.internal.CertUtils.createTrustStore(CertUtils.java:71)
        at io.fabric8.kubernetes.client.internal.SSLUtils.trustManagers(SSLUtils.java:114)
        at io.fabric8.kubernetes.client.internal.SSLUtils.trustManagers(SSLUtils.java:93)
        at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:63)
        ... 25 more
Caused by: java.io.IOException: Empty input
        at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:106)
        ... 31 more
1

1 Answers

0
votes

It is unclear whether if you're deploying it to an RBAC enabled cluster. If you're indeed on an RBAC cluster, you'd have to add "roles" and "role-bindings" prior to deploying the SCDF server. You'd notice the following note in the reference guide.

The latest releases of kubernetes have enabled RBAC on the api-server. If your target platform has RBAC enabled you must ask a cluster-admin to create the roles and role-bindings for you before deploying the dataflow server. They associate the dataflow service account with the roles it needs to be run with.