Java client library for OpenShift REST APIs, providing fluent DSL access to OpenShift resources and operations.
—
OpenShift cluster configuration through the config.openshift.io API group. Manages cluster-wide settings for authentication, networking, builds, DNS, ingress, feature gates, and infrastructure components.
/**
* Access to OpenShift Configuration API Group (config.openshift.io/v1)
* Cluster-wide configuration resources
*/
OpenShiftConfigAPIGroupDSL config();Essential cluster infrastructure settings including API servers, authentication, DNS, networking, and proxy configuration.
interface OpenShiftConfigAPIGroupDSL {
/** API server configuration and settings */
NonNamespaceOperation<APIServer, APIServerList, Resource<APIServer>> apiServers();
/** Cluster authentication configuration */
NonNamespaceOperation<Authentication, AuthenticationList, Resource<Authentication>> authentications();
/** Cluster DNS configuration */
NonNamespaceOperation<DNS, DNSList, Resource<DNS>> dnses();
/** Cluster networking configuration */
NonNamespaceOperation<Network, NetworkList, Resource<Network>> networks();
/** Cluster proxy configuration */
NonNamespaceOperation<Proxy, ProxyList, Resource<Proxy>> proxies();
/** Infrastructure platform configuration */
NonNamespaceOperation<Infrastructure, InfrastructureList, Resource<Infrastructure>> infrastructures();
/** OAuth authentication configuration */
NonNamespaceOperation<OAuth, OAuthList, Resource<OAuth>> oAuths();
}Usage Examples:
// Get cluster authentication configuration
Authentication auth = client.config().authentications().withName("cluster").get();
// Get cluster DNS configuration
DNS dns = client.config().dnses().withName("cluster").get();
String clusterDomain = dns.getSpec().getClusterDomain();
// Get network configuration
Network network = client.config().networks().withName("cluster").get();
String serviceNetwork = network.getSpec().getServiceNetwork().get(0);
// Get infrastructure details
Infrastructure infra = client.config().infrastructures().withName("cluster").get();
String platform = infra.getStatus().getPlatform();Cluster-wide build and image management settings including build defaults, image registry configuration, and image content policies.
interface OpenShiftConfigAPIGroupDSL {
/** Cluster build configuration and defaults */
NonNamespaceOperation<Build, BuildList, Resource<Build>> builds();
/** Image configuration and registry settings */
NonNamespaceOperation<Image, ImageList, Resource<Image>> images();
/** Image content policies and restrictions */
NonNamespaceOperation<ImageContentPolicy, ImageContentPolicyList, Resource<ImageContentPolicy>> imageContentPolicies();
/** Image digest mirror sets for registry mirroring */
NonNamespaceOperation<ImageDigestMirrorSet, ImageDigestMirrorSetList, Resource<ImageDigestMirrorSet>> imageDigestMirrorSets();
/** Image tag mirror sets for registry mirroring */
NonNamespaceOperation<ImageTagMirrorSet, ImageTagMirrorSetList, Resource<ImageTagMirrorSet>> imageTagMirrorSets();
}Usage Examples:
// Get cluster build configuration
Build buildConfig = client.config().builds().withName("cluster").get();
// Get image configuration
Image imageConfig = client.config().images().withName("cluster").get();
String externalRegistryHostname = imageConfig.getStatus().getExternalRegistryHostnames().get(0);
// List image content policies
ImageContentPolicyList policies = client.config().imageContentPolicies().list();Ingress controller and web console configuration for cluster access and user interface settings.
interface OpenShiftConfigAPIGroupDSL {
/** Ingress controller configuration */
NonNamespaceOperation<Ingress, IngressList, Resource<Ingress>> ingresses();
/** Web console configuration */
NonNamespaceOperation<Console, ConsoleList, Resource<Console>> consoles();
}Usage Examples:
// Get ingress configuration
Ingress ingress = client.config().ingresses().withName("cluster").get();
String appsDomain = ingress.getSpec().getDomain();
// Get console configuration
Console console = client.config().consoles().withName("cluster").get();
String consoleURL = console.getStatus().getConsoleURL();Feature gate management and cluster capability configuration for enabling/disabling OpenShift features.
interface OpenShiftConfigAPIGroupDSL {
/** Feature gates for enabling/disabling cluster features */
NonNamespaceOperation<FeatureGate, FeatureGateList, Resource<FeatureGate>> featureGates();
/** Scheduler configuration */
NonNamespaceOperation<Scheduler, SchedulerList, Resource<Scheduler>> schedulers();
/** OperatorHub configuration */
NonNamespaceOperation<OperatorHub, OperatorHubList, Resource<OperatorHub>> operatorHubs();
/** Project configuration and defaults */
NonNamespaceOperation<Project, ProjectList, Resource<Project>> projects();
}Usage Examples:
// Get feature gate configuration
FeatureGate featureGate = client.config().featureGates().withName("cluster").get();
Set<String> enabledFeatures = featureGate.getSpec().getFeatureSet();
// Get scheduler configuration
Scheduler scheduler = client.config().schedulers().withName("cluster").get();
// Get OperatorHub configuration
OperatorHub operatorHub = client.config().operatorHubs().withName("cluster").get();
boolean disableAllDefaultSources = operatorHub.getSpec().getDisableAllDefaultSources();Cluster version information and operator status monitoring.
interface OpenShiftConfigAPIGroupDSL {
/** Cluster version and update information */
NonNamespaceOperation<ClusterVersion, ClusterVersionList, Resource<ClusterVersion>> clusterVersions();
/** Cluster operator status and health */
NonNamespaceOperation<ClusterOperator, ClusterOperatorList, Resource<ClusterOperator>> clusterOperators();
}Usage Examples:
// Get cluster version
ClusterVersion version = client.config().clusterVersions().withName("version").get();
String currentVersion = version.getStatus().getDesired().getVersion();
List<Update> availableUpdates = version.getStatus().getAvailableUpdates();
// List cluster operators and their status
ClusterOperatorList operators = client.config().clusterOperators().list();
for (ClusterOperator operator : operators.getItems()) {
String name = operator.getMetadata().getName();
List<ClusterOperatorStatusCondition> conditions = operator.getStatus().getConditions();
boolean available = conditions.stream()
.anyMatch(c -> "Available".equals(c.getType()) && "True".equals(c.getStatus()));
System.out.println(name + " available: " + available);
}
// Get specific operator status
ClusterOperator ingressOperator = client.config().clusterOperators()
.withName("ingress")
.get();try (OpenShiftClient client = new KubernetesClientBuilder().build().adapt(OpenShiftClient.class)) {
// Get overall cluster information
Infrastructure infra = client.config().infrastructures().withName("cluster").get();
System.out.println("Platform: " + infra.getStatus().getPlatform());
System.out.println("Region: " + infra.getStatus().getPlatformStatus().getAws().getRegion());
// Check cluster version and available updates
ClusterVersion version = client.config().clusterVersions().withName("version").get();
System.out.println("Current version: " + version.getStatus().getDesired().getVersion());
// Check DNS and networking
DNS dns = client.config().dnses().withName("cluster").get();
Network network = client.config().networks().withName("cluster").get();
System.out.println("Cluster domain: " + dns.getSpec().getClusterDomain());
System.out.println("Service network: " + network.getSpec().getServiceNetwork());
// Check ingress configuration
Ingress ingress = client.config().ingresses().withName("cluster").get();
System.out.println("Apps domain: " + ingress.getSpec().getDomain());
}// Check and modify feature gates
FeatureGate featureGate = client.config().featureGates().withName("cluster").get();
// Create custom feature gate configuration (typically not recommended)
FeatureGate customFeatureGate = new FeatureGateBuilder()
.withMetadata(new ObjectMetaBuilder().withName("cluster").build())
.withSpec(new FeatureGateSpecBuilder()
.withFeatureSet("CustomNoUpgrade")
.build())
.build();
// Note: Modifying feature gates can affect cluster stability
// client.config().featureGates().createOrReplace(customFeatureGate);Install with Tessl CLI
npx tessl i tessl/maven-io-fabric8--openshift-client