Skip to content

Running kompose under k3s failed #1270

Closed
@moluzhui

Description

I installed K3s with the following command and succeeded

# export INSTALL_K3S_EXEC="--write-kubeconfig ~/.kube/config --write-kubeconfig-mode 666"
# curl -sfL https://docs.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -

Then I tried starting docker-compos.yaml with the official example

version: "2"

services:
  redis-master:
    image: gcr.io/google_containers/redis:e2e
    ports:
      - "6379"
  redis-slave:
    image: gcr.io/google_samples/gb-redisslave:v1
    ports:
      - "6379"
    environment:
      - GET_HOSTS_FROM=dns
  frontend:
    image: gcr.io/google-samples/gb-frontend:v4
    ports:
      - "80:80"
    environment:
      - GET_HOSTS_FROM=dns

But when I started, I found it only launched the service did not start deployments

# kompose -f docker-compose.yaml up
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. 
 
INFO Deploying application in "default" namespace 
INFO Successfully created Service: frontend       
INFO Successfully created Service: redis-master   
INFO Successfully created Service: redis-slave    

Your application has been deployed to Kubernetes. You can run 'kubectl get deployment,svc,pods,pvc' for details.

# kubectl get deployment,svc,pods,pvc
NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/kubernetes     ClusterIP   10.43.0.1       <none>        443/TCP    14h
service/frontend       ClusterIP   10.43.62.105    <none>        80/TCP     8s
service/redis-master   ClusterIP   10.43.11.115    <none>        6379/TCP   8s
service/redis-slave    ClusterIP   10.43.180.220   <none>        6379/TCP   8s

Whether I have no configuration somewhere or kompose itself is not available on k3s?

OS is Ubuntu 18.04.2 LTS
k3s version is v1.17.4+k3s1 (3eee8ac3)
kompose version is 1.21.0 (992df58d8)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions