How to navigate inside a Custom Resource to know its spec in OCP 4?
Environment
- Red Hat Openshift Container Platform
- 4.x
- Operators
Issue
- How to see the options for a certain Custom Resource in Openshift 4?
- Options for CR navigation
Resolution
Use oc explain to navigate through the Custom Resource definitions.
oc explain apicurioregistries.registry.apicur.io.spec.
oc explain apicurioregistries.registry.apicur.io.spec.deployment
oc explain apicurioregistries.registry.apicur.io.spec.deployment.podTemplateSpecPreview
oc explain apicurioregistries.registry.apicur.io.spec.deployment.podTemplateSpecPreview.spec.
Example:
$ oc explain infinispan.spec
GROUP: infinispan.org
KIND: Infinispan
VERSION: v1
FIELD: spec <Object>
DESCRIPTION:
InfinispanSpec defines the desired state of Infinispan
FIELDS:
affinity <Object>
Deprecated. Use scheduling.affinity instead
autoscale <Object>
Autoscale describe autoscaling configuration for the cluster
cloudEvents <Object>
Deprecated. Has no effect starting with Infinispan 15.0.0 servers
configListener <Object>
<no description>
configMapName <string>
<no description>
container <Object>
InfinispanContainerSpec specify resource requirements per container
dependencies <Object>
External dependencies needed by the Infinispan cluster
expose <Object>
ExposeSpec describe how Infinispan will be exposed externally
image <string>
<no description>
jmx <Object>
<no description>
logging <Object>
<no description>
replicas <integer> -required-
The number of nodes in the Infinispan cluster.
scheduling <Object>
<no description>
security <Object>
InfinispanSecurity info for the user application connection
service <Object>
InfinispanServiceSpec specify configuration for specific service
upgrades <Object>
Strategy to use when doing upgrades
version <string>
The semantic version of the Infinispan cluster.
Using --recursive can be useful as well: $ oc explain infinispan.spec --recursive:
$ oc explain infinispan.spec --recursive
GROUP: infinispan.org
KIND: Infinispan
VERSION: v1
FIELD: spec <Object>
DESCRIPTION:
InfinispanSpec defines the desired state of Infinispan
FIELDS:
affinity <Object>
nodeAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
preference <Object> -required-
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchFields <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <Object>
nodeSelectorTerms <[]Object> -required-
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchFields <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
podAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
podAffinityTerm <Object> -required-
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <[]Object>
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
podAntiAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
podAffinityTerm <Object> -required-
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <[]Object>
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
autoscale <Object>
disabled <boolean>
maxMemUsagePercent <integer> -required-
maxReplicas <integer> -required-
minMemUsagePercent <integer> -required-
minReplicas <integer> -required-
cloudEvents <Object>
acks <string>
bootstrapServers <string> -required-
cacheEntriesTopic <string>
configListener <Object>
cpu <string>
enabled <boolean>
logging <Object>
level <string>
enum: debug, info, error
memory <string>
configMapName <string>
container <Object>
cliExtraJvmOpts <string>
cpu <string>
extraJvmOpts <string>
memory <string>
routerExtraJvmOpts <string>
dependencies <Object>
artifacts <[]Object>
hash <string>
maven <string>
type <string>
enum: file, zip, tgz
url <string>
initContainer <Object>
cpu <string>
memory <string>
volumeClaimName <string>
expose <Object>
annotations <map[string]string>
host <string>
nodePort <integer>
port <integer>
type <string> -required-
enum: NodePort, LoadBalancer, Route
image <string>
jmx <Object>
enabled <boolean>
logging <Object>
categories <map[string]string>
pattern <string>
replicas <integer> -required-
scheduling <Object>
PriorityClassName <string>
affinity <Object>
nodeAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
preference <Object> -required-
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchFields <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <Object>
nodeSelectorTerms <[]Object> -required-
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchFields <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
podAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
podAffinityTerm <Object> -required-
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <[]Object>
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
podAntiAffinity <Object>
preferredDuringSchedulingIgnoredDuringExecution <[]Object>
podAffinityTerm <Object> -required-
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
weight <integer> -required-
requiredDuringSchedulingIgnoredDuringExecution <[]Object>
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaceSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
namespaces <[]string>
topologyKey <string> -required-
tolerations <[]Object>
effect <string>
key <string>
operator <string>
tolerationSeconds <integer>
value <string>
topologySpreadConstraints <[]Object>
labelSelector <Object>
matchExpressions <[]Object>
key <string> -required-
operator <string> -required-
values <[]string>
matchLabels <map[string]string>
maxSkew <integer> -required-
minDomains <integer>
topologyKey <string> -required-
whenUnsatisfiable <string> -required-
security <Object>
authorization <Object>
enabled <boolean>
roles <[]Object>
name <string> -required-
permissions <[]string> -required-
credentialStoreSecretName <string>
endpointAuthentication <boolean>
endpointEncryption <Object>
certSecretName <string>
certServiceName <string>
clientCert <string>
enum: None, Authenticate, Validate
clientCertSecretName <string>
type <string>
enum: Service, service, Secret, secret, ....
endpointSecretName <string>
service <Object>
container <Object>
ephemeralStorage <boolean>
livenessProbe <Object>
failureThreshold <integer>
initialDelaySeconds <integer>
periodSeconds <integer>
successThreshold <integer>
timeoutSeconds <integer>
readinessProbe <Object>
failureThreshold <integer>
initialDelaySeconds <integer>
periodSeconds <integer>
successThreshold <integer>
timeoutSeconds <integer>
startupProbe <Object>
failureThreshold <integer>
initialDelaySeconds <integer>
periodSeconds <integer>
successThreshold <integer>
timeoutSeconds <integer>
storage <string>
storageClassName <string>
replicationFactor <integer>
sites <Object>
local <Object> -required-
discovery <Object>
cpu <string>
heartbeats <Object>
enabled <boolean>
interval <integer>
timeout <integer>
launchGossipRouter <boolean>
memory <string>
suspectEvents <boolean>
type <string>
enum: gossiprouter
encryption <Object>
protocol <string>
enum: TLSv1.2, TLSv1.3
routerKeyStore <Object> -required-
alias <string>
filename <string>
secretName <string> -required-
transportKeyStore <Object> -required-
alias <string>
filename <string>
secretName <string> -required-
trustStore <Object>
filename <string>
secretName <string> -required-
expose <Object> -required-
annotations <map[string]string>
nodePort <integer>
port <integer>
routeHostName <string>
type <string> -required-
enum: NodePort, LoadBalancer, ClusterIP, Route
maxRelayNodes <integer>
name <string> -required-
locations <[]Object>
clusterName <string>
host <string>
name <string> -required-
namespace <string>
port <integer>
secretName <string>
url <string>
type <string>
enum: DataGrid, Cache
upgrades <Object>
type <string> -required-
version <string>
SBR
Product(s)
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.