Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Using Volume Mounter trait results in Kubernetes Service creation failure #524

Open
abhirockzz opened this issue Jan 28, 2020 · 2 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@abhirockzz
Copy link
Contributor

Output of helm version:

version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.7", GitCommit:"6c143d35bb11d74970e7bc0b6c45b6bfdffc0bd4", GitTreeState:"clean", BuildDate:"2019-12-13T18:46:24Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): AKS

Describe the bug

Using Volume Mounter trait results in Kubernetes Service creation failure

OAM yaml files used

Component

apiVersion: core.oam.dev/v1alpha1
kind: ComponentSchematic
metadata:
  name: emphemeral-vol-example
spec:
  workloadType: core.oam.dev/v1alpha1.Server
  containers:
    - name: server
      image: nginx:latest
      resources:
        volumes:
          - name: emphemeral-vol
            mountPath: /emphemeral-vol
            disk:
              required: "50M"
              ephemeral: true

App config

apiVersion: core.oam.dev/v1alpha1
kind: ApplicationConfiguration
metadata:
  name: example-server-with-volume
spec:
  components:
    - componentName: emphemeral-vol-example
      instanceName: emphemeral-vol-example1
      traits:
        - name: volume-mounter
          properties:
            volumeName: emphemeral-vol
            storageClass: default

What happened:

Kubernetes Service was not created - kubectl get svc did not contain the expected service and ComponentSchematic reported failure status (for Service):

kubectl get applicationconfiguration.core.oam.dev/example-server-with-volume -o yaml returned

status:
  components:
    emphemeral-vol-example:
      deployment/emphemeral-vol-example1: running
      persistentvolumeclaim/emphemeral-vol: Bound
      service/emphemeral-vol-example1: ApiError NotFound ("services \"emphemeral-vol-example1\"
        not found")
  phase: synced

Notice service/emphemeral-vol-example1: ApiError NotFound ("services \"emphemeral-vol-example1\" not found")

What you expected to happen:

Service to be created

Relevant screenshots:

How to reproduce it (as minimally and precisely as possible):

Create component and app config (pasted above)

Anything else we need to know:

The Deployment was created (and so did the other kubernetes objects). Service creation failed

@abhirockzz abhirockzz added the Type: Bug Something isn't working label Jan 28, 2020
@zhxu2
Copy link
Contributor

zhxu2 commented Jan 30, 2020

I was able to reproduce this

rudr::workload_type::workload_builder] Not attaching service to pod with n
o container ports.

if you don't sepecify a containerPort in your component spec, rudr will skip service creation
I agree that "Not Found" status is confusing though. I'll try to make it look friendly

@macolso this can be relabeled "enhancement"

@abhirockzz
Copy link
Contributor Author

Ah I see! Thanks @zhxu2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants