kubernetes / kompose

Convert Compose to Kubernetes
http://kompose.io
Apache License 2.0
9.51k stars 749 forks source link

FATA Error while deploying application: deployments.extensions "cache" already exists #1138

Closed hazcod closed 5 years ago

hazcod commented 5 years ago

Hi,

Kompose 1.18.0 FIrst time trying to deploy to kubernetes (on GKE) and I'm trying to re-use my composefiles.

$ kompose -f yml --verbose up       
DEBU Docker Compose version: 3                    
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 
FATA Error while deploying application: deployments.extensions "cache" already exists 

Any idea what I'm doing wrong? Composefile:

version: '3'

volumes:
    db-data:
    ssl:
    mail-data:
    mq-data:
    openvas-data:

networks:
  frontend:

  backend:

services:
    cache:
        container_name: cache
        image: "cache:${stage}"
        hostname: cache
        expose:
            - 11211
        tty: false
        restart: "always"
        read_only: true
        tmpfs:
            - /tmp/
        security_opt:   
            - "no-new-privileges"
        networks:
            - backend
        deploy:
            resources:
                limits:
                    memory: 4GB

    db:
        container_name: db
        image: "db:${stage}"
        hostname: db
        volumes:
            - db-data:/app/data
        expose:
            - 5432
        tty: false
        restart: "always"
        read_only: true
        tmpfs:
            - /tmp/
        security_opt:   
            - "no-new-privileges"
        networks:
            - backend
        deploy:
            resources:
                limits:
                    memory: 2GB

    download:
        container_name: download
        image: "download:${stage}"
        hostname: download
        tmpfs: /tmp/  
        cap_add:
            - NET_BIND_SERVICE
        expose:
            - 8080
        tty: false
        restart: "always"
        read_only: true

        security_opt:
            - "no-new-privileges"
        deploy:
            resources:
                limits:
                    memory: 1GB
        networks:
            - backend

    mail:
        container_name: mail
        image: "mail:${stage}"
        hostname: mail
        expose:
          - 25000
        volumes:
            - mail-data:/app/data
        tty: true
        restart: "always"
        read_only: true
        tmpfs:
            - /tmp
        security_opt:
            - "no-new-privileges"
        networks:
            - backend

    mq:
        container_name: mq
        image: "mq:${stage}"
        hostname: mq
        expose:
            - 5673
        tty: false
        restart: "always"
        #read_only: true #touch /etc/rabbitmq/rabbitmq.conf
        security_opt:   
            - "no-new-privileges"
        networks:
            - backend
        volumes:
            - mq-data:/var/lib/rabbitmq
        deploy:
            resources:
                limits:
                    memory: 4GB

    openvas:
        container_name: openvas
        image: mikesplain/openvas
        hostname: openvas
        tty: false
        restart: "always"
        #    ports:
        #    - "4433:443"
        expose:
        - 4433
        security_opt:
        - "no-new-privileges"
        deploy:
          resources:
            limits:
              memory: 6GB
        networks:
        - backend
        volumes:
          - openvas-data:/var/lib/openvas/mgr/
        healthcheck:
          test: ["CMD", "curl -k https://localhost:8443/login/login.html"]
          interval: 30s

    php:
        container_name: php
        image: "php:${stage}"
        hostname: php
        expose:
            - 8080
        tty: false
        read_only: true
        tmpfs: /tmp/
        security_opt:
            - "no-new-privileges"
        networks:
            - backend
        deploy:
            resources:
                limits:
                    memory: 4GB
        depends_on:
            - db
        links:
            - db
            - mail
            - mq

    processor:
        container_name: processor
        image: "slave:${stage}"
        links:
          - mq
          - db
        tty: false
        restart: "always"
        read_only: true

        security_opt:
            - "no-new-privileges"
        deploy:
            resources:
                limits:
                    memory: 4GB
        depends_on:
            - slave
            - mq
            - db
        networks:
            - backend

    slave:
        container_name: slave
        image: "slave:${stage}"
        links:
          - mq
          - openvas
          - mail
        tty: false
        restart: "always"
        read_only: true

        security_opt:
            - "no-new-privileges"
        deploy:
            resources:
                limits:
                    memory: 4GB
        depends_on:
            - mq
            - openvas
            - mail
        networks:
            - backend

    web:
        container_name: web
        image: "web:${stage}"
        hostname: web
        tmpfs: /tmp/  
        cap_add:
            - NET_BIND_SERVICE
        expose:
            - 8080
            - 8443
        tty: false
        restart: "always"
        read_only: true

        security_opt:
            - "no-new-privileges"
        deploy:
            resources:
                limits:
                    memory: 4GB
        depends_on:
            - php
            - download
        networks:
            - frontend
            - backend
        links:
            - php
            - download
hazcod commented 5 years ago

Seems to be fixed with kubectl apply..