compose2kube icon indicating copy to clipboard operation
compose2kube copied to clipboard

services generated with invalid spec definition

Open ghost opened this issue 8 years ago • 0 comments

While attempting to convert the bundled docker-compose.yml to a k8s config, services are generated with an invalid ServiceSpec definition.

Per v1.ServiceSpec there is no field defined as ExternalName.

This has the side effect of causing the services to not launch correctly.

Tested with clusters built with both minikube and kube-aws.

  • kube-aws cluster version
johnt  ⋯  gitroot   compose2kube  kubectl version                                                                                                                                                          master ★ 0.0.2  01:49
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6+ae4550c", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"not a git tree", BuildDate:"2016-08-30T15:45:51Z", GoVersion:"go1.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.2+coreos.0", GitCommit:"52a0d5141b1c1e7449189bb0be3374d610eb98e0", GitTreeState:"clean", BuildDate:"2016-07-19T17:45:13Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
  • via kube-aws cluster:
 johnt  ⋯  gitroot  compose2kube  kubectl create -f ./output                                                                                                                                               master ★ 0.0.2  01:48
replicationcontroller "cache" created
replicationcontroller "database" created
replicationcontroller "web" created
error validating "output/cache-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "output/database-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "output/web-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
  • minikube cluster version
 johnt  ⋯  gitroot  compose2kube  kubectl version                                                                                                                                                          master ★ 0.0.2  02:04
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6+ae4550c", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"not a git tree", BuildDate:"2016-08-30T15:45:51Z", GoVersion:"go1.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.3", GitCommit:"c6411395e09da356c608896d3d9725acab821418", GitTreeState:"dirty", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
  • via minikube cluster
 johnt  ⋯  gitroot  compose2kube  kubectl create -f ./output                                                                                                                                          1   master ★ 0.0.2  02:05
replicationcontroller "cache" created
replicationcontroller "database" created
replicationcontroller "web" created
error validating "output/cache-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "output/database-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "output/web-srv.yml": error validating data: found invalid field ExternalName for v1.ServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false
  • generated service config (output/cache-srv.yml)
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  name: cache
  namespace: default
spec:
  ExternalName: ""
  ports:
  - name: ""
    nodePort: 0
    port: 11211
    protocol: ""
    targetPort: 0
  selector:
    service: cache
status:
  loadBalancer: {}

Should this field be removed from the generated file?

I don't see a reference in the source either https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/service.go

ghost avatar Sep 11 '16 09:09 ghost