Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:40
    stale[bot] unlabeled #4342
  • 00:40
    henrik242 commented #4342
  • 00:27
    stale[bot] labeled #3984
  • 00:27
    stale[bot] labeled #4332
  • 00:27
    stale[bot] labeled #4342
  • 00:27
    stale[bot] labeled #4190
  • 00:27
    stale[bot] commented #3984
  • 00:27
    stale[bot] commented #4332
  • 00:27
    stale[bot] commented #4342
  • 00:27
    stale[bot] commented #4190
  • Nov 28 22:44
    sonarcloud[bot] commented #4601
  • Nov 28 22:44
    sonarcloud[bot] commented #4601
  • Nov 28 22:12
    shawkins synchronize #4601
  • Nov 28 22:07
    sonarcloud[bot] commented #4601
  • Nov 28 22:07
    sonarcloud[bot] commented #4601
  • Nov 28 22:03
    sonarcloud[bot] commented #4615
  • Nov 28 22:03
    sonarcloud[bot] commented #4615
  • Nov 28 21:45
    shawkins commented #4517
Marc Nuri
@manusa
Starting release process for v6.1.0
Marc Nuri
@manusa
Sonatype's Nexus is acting funny today. Still trying to release
Marc Nuri
@manusa
Starting release process for v6.1.1
Marcos F. Lobo
@marcosflobo

Hello team,

I'm kind of new on the fabic8 library.

My question is around Custom Resources. Would you have an example about reading the properties under spec section in a typeless way? I cannot find an example for reading, only for creating/updating/deleting

Thanks in advance!

Rohan Kumar
@rohanKanojia
I think spec should be available in additionalProperties map
It would look a bit ugly but you would need to read map and use casting
Marcos F. Lobo
@marcosflobo
@rohanKanojia would you have some example, typeless, to "get a deployed custom resource"? I cannot find a typeless example
Rohan Kumar
@rohanKanojia
I think something like this should work:
    try (KubernetesClient client = new KubernetesClientBuilder().build()) {
      CustomResourceDefinitionContext context = new CustomResourceDefinitionContext.Builder()
          .withGroup("sparkoperator.k8s.io")
          .withScope("Namespaced")
          .withVersion("v1beta2")
          .withPlural("sparkapp")
          .build();

      GenericKubernetesResource cr = client.genericKubernetesResources(context)
          .inNamespace("test-ns")
          .withName("foo")
          .get();
      }
3 replies
Michael Anstis
@manstis
Hi, I have a question about Java Custom Resources with typed fields.
and I would like to know what Java types in the spec are automatically mapped to/from the CR yaml
all examples seem to limit themselves to String or Integer or Boolean
What's the best approach for java.util.Date fields (or java.time.ZonedDateTime etc)?
Do I need to handle serialisation to/from a String myself or is there some automated mapping (pluggable?) for different types?
Rohan Kumar
@rohanKanojia

What's the best approach for java.util.Date fields (or java.time.ZonedDateTime etc)?

Could you please start a github discussion for this? https://github.com/fabric8io/kubernetes-client/discussions

Rohan Kumar
@rohanKanojia
nautiam
@nautiam
Hi, I have a question about Config
In v5.12.1, I create a new OpenShiftClient as below:
Config config = new ConfigBuilder()
                     .withMasterUrl(MASTER_URL)
                     .withUsername(USERNAME)
                     .withPassword(PASSWORD)
                     .build();
OpenShiftClient osClient = new DefaultOpenShiftClient(config);

But when I update to v6.1.1, it doens't work. I change source code to use KubernetesClientBuilder

Config config = new ConfigBuilder()
                    .withMasterUrl(MASTER_URL)
                    .withUsername(USERNAME)
                    .withPassword(PASSWORD)
                    .build();
OpenShiftClient osClient = new KubernetesClientBuilder().withConfig(config).build().adapt(OpenShiftClient.class);

My Openshift is using htpasswd Authentication. Do I miss anything in Configuration?

1 reply
Dobromir Marinov
@DobromirM
Hi, I am using the fabric8io kubernetes client and I am trying to get the logs for a deployment with timestamps but the timestamps seem to be available only for pods. Is there a workaround for that?
5 replies
Marc Nuri
@manusa
Starting release process for v5.12.14
Dobromir Marinov
@DobromirM
Are the tests flaky, because some of them fail on my PR but run fine on the same branch in my forked repo?
Rohan Kumar
@rohanKanojia
I think some tests are flaky. Are you talking about unit tests or integration tests?
Dobromir Marinov
@DobromirM
I think both. The Java 11 Maven build failed with StackOverflowError when compiling a Maven plugin and one of the E2E tests failed on an assertion. fabric8io/kubernetes-client#4481
Marc Nuri
@manusa
Starting release process for v6.2.0
maninder321
@maninder321
Hi, I am new here. How can I contribute?
Rohan Kumar
@rohanKanojia
@maninder321 : Please check out our CONTRIBUTING.md https://github.com/fabric8io/kubernetes-client/blob/master/CONTRIBUTING.md
Gyula Fora
@gyfora

Hey Team!
I am looking at the new Interceptor inteface (https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/http/Interceptor.java)

As we are migrating from v5 -> v6. We had a previous okhttp interceptor implementation that we want to migrate.

I am trying to look for a way to measure response time from the interceptor. The new interface has a before method but there is no after or seemingly any other way to simply measure the response time. Set a timer before & stop it after response.

Can someone please point me in the right direction?

Mehul
@infiniteregrets:matrix.org
[m]

hi there! I am currently facing an exception with my intellij plugin at runtime which uses gradle. I added the fabric8 dependency like so

dependencies {
    implementation("com.github.zafarkhaja:java-semver:0.9.0")
    implementation("io.fabric8:kubernetes-client:6.2.0") {
        exclude(group = "org.slf4j", module = "slf4j-api")
    }
}

and I get this:

io.fabric8.kubernetes.client.KubernetesClientException: No httpclient implementations found on the context classloader, please ensure your classpath includes an implementation jar
    at io.fabric8.kubernetes.client.utils.HttpClientUtils.getHttpClientFactory(HttpClientUtils.java:164)
    at io.fabric8.kubernetes.client.KubernetesClientBuilder.build(KubernetesClientBuilder.java:76)
    at com.metalbear.mirrord.KubeDataProvider.<init>(KubeDataProvider.kt:8)
    at com.metalbear.mirrord.MirrordListener.processStartScheduled$lambda-3(MirrordListener.kt:43)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
    at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
    at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Any ideas on how I could resolve this? Thanks!

Mehul
@infiniteregrets:matrix.org
[m]

please ensure your classpath includes an implementation jar

i checked my project structure and libraries and the dependency seems to be listed there, not sure what is missing

Rohan Kumar
@rohanKanojia
Hi, are you sure you have io.fabric8:kubernetes-httpclient-okhttp dependency in your project?
raj4046
@raj4046:matrix.org
[m]

@all
I am trying to create Virtual service using operator
I am using fabric8 istio extension
Ex:
https://github.com/fabric8io/kubernetes-client/blob/master/extensions/istio/examples/src/main/java/io/fabric8/istio/api/examples/v1beta1/VirtualServiceExample.java

But i am not getting what are the value i need to pass through CLI

https://github.com/fabric8io/kubernetes-client/blob/master/extensions/istio/examples/src/main/java/io/fabric8/istio/api/examples/v1beta1/ClientFactory.java

for pod creation and deployment i am using k8s client it working fine
Ex; private final KubernetesClient client;

raj4046
@raj4046:matrix.org
[m]

:point_up: Edit: @all
I am trying to create Virtual service using operator
I am using fabric8 istio extension
Ex:
https://github.com/fabric8io/kubernetes-client/blob/master/extensions/istio/examples/src/main/java/io/fabric8/istio/api/examples/v1beta1/VirtualServiceExample.java

But i am not getting what are the value i need to pass through CLI

https://github.com/fabric8io/kubernetes-client/blob/master/extensions/istio/examples/src/main/java/io/fabric8/istio/api/examples/v1beta1/ClientFactory.java

for pod creation and deployment i am using k8s client it working fine
Ex; private final KubernetesClient client;
@rohanKanojia @adietish

Rohan Kumar
@rohanKanojia
What error are you getting?
raj4046
@raj4046:matrix.org
[m]
Not able to create client
Rohan Kumar
@rohanKanojia
Could you please create an issue with complete error stacktrace?
Jeff MAURY
@jeffmaury
How can I retrieve the list of operators. I found OpenShiftOperatorHubAPIGroupDSL so I tried to adapt my client to it but it seems there is no adapter for it. So what the way to access it ?
OK I found it I need to use the OpenShiftClient which seems wrong to me because ClusterServiceVersion is available on raw Kube
Rohan Kumar
@rohanKanojia
Isn't ClusterServiceVersion an openshift resource (comes pre-installed with OpenShift) ?
From KubernetesClient interface you'd have DSL access to raw Kubernetes resources only. From OpenShiftClient you can get OpenShift-specific resources.
I think it must be available on raw Kube as a CRD
Jeff MAURY
@jeffmaury
@rohanKanojia it comes with OpenShift but if you install operator-lifecycle-manager then this CRD is then available
Rohan Kumar
@rohanKanojia
oh, okay