quarkusio/quarkus · error · IllegalArgumentException

Could not find DeploymentResourceKind for

Error message

Could not find DeploymentResourceKind for 

What it means

DeploymentResourceKind.find maps an (apiGroup, apiVersion, kind) triple to a known enum constant for Kubernetes deployment resources (Deployment, StatefulSet, etc.). If no constant matches the requested group/version/kind, it throws IllegalArgumentException including the apiGroupVersion and kind.

Source

Thrown at extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/DeploymentResourceKind.java:59

        this(kind, group, version, Set.of(requiredTargets));
    }

    DeploymentResourceKind(String kind, String group, String version, Set<String> requiredTargets) {
        this.kind = kind;
        this.group = group;
        this.version = version;
        this.requiredTargets = requiredTargets;
    }

    public static DeploymentResourceKind find(String apiGroup, String apiVersion, String kind) {
        for (DeploymentResourceKind deploymentResourceKind : DeploymentResourceKind.values()) {
            if (deploymentResourceKind.kind.equals(kind) && deploymentResourceKind.group.equals(apiGroup)
                    && deploymentResourceKind.version.equals(apiVersion)) {
                return deploymentResourceKind;
            }
        }
        String apiGroupVersion = Strings.isNullOrEmpty(apiGroup) ? apiVersion : apiGroup + "/" + apiVersion;
        throw new IllegalArgumentException("Could not find DeploymentResourceKind for " + apiGroupVersion + " " + kind);
    }

    public boolean isAvailalbleOn(String target) {
        return requiredTargets.isEmpty() || requiredTargets.contains(target);
    }

    public boolean matches(HasMetadata resource) {
        String resourceKind = HasMetadata.getKind(resource.getClass());
        String resourceVersion = HasMetadata.getApiVersion(resource.getClass());
        return resourceKind.equals(getKind()) && resourceVersion.equals(getApiVersion());
    }

    public String getKind() {
        return kind;
    }

    public String getGroup() {
        return group;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set quarkus.kubernetes.deployment.kind to a supported value: Deployment, StatefulSet, DaemonSet, or Job
  2. Fix typos and use the correct API version, e.g. apps/v1
  3. Check DeploymentResourceKind's supported values in the Quarkus version you are using — newer kinds require newer Quarkus

Example fix

// before
quarkus.kubernetes.deployment.kind=DeploymentEXT
// after
quarkus.kubernetes.deployment.kind=Deployment
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("Deployment","StatefulSet","DaemonSet","Job");
if (!allowed.contains(configKind)) throw new IllegalArgumentException("unsupported kind: " + configKind);

Type guard

static boolean isSupportedKind(String kind) {
    for (DeploymentResourceKind k : DeploymentResourceKind.values()) {
        if (k.name().equalsIgnoreCase(kind)) return true;
    }
    return false;
}

Prevention

When it happens

Trigger: Requesting a deployment resource kind via quarkus.kubernetes.deployment.kind (or config in KubernetesConfig) whose group/version/kind is not one of the supported DeploymentResourceKind values.

Common situations: Typo in deployment.kind; targeting a resource kind not supported (e.g. 'ArgoCD' or 'Rollout'); version mismatch such as apps/v1beta1 instead of apps/v1.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/b2dc78a6b417ee60. Report an issue: GitHub.