Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insufficient cpu #856

Closed
u007 opened this issue Oct 21, 2017 · 8 comments
Closed

insufficient cpu #856

u007 opened this issue Oct 21, 2017 · 8 comments

Comments

@u007
Copy link

u007 commented Oct 21, 2017

kompose 1.3.0 ()
Google Cloud SDK 176.0.0
alpha 2017.09.15
bq 2.0.27
core 2017.10.13
gsutil 4.27

hi,

i have this docker-compose file which works fine on docker with gloud gce.
but when deployed using kompose,
i keep getting "insufficient cpu" on either or both redis and nginx pods

even resizing cluster count to 2, it keep giving the same error.
does it take into consideration of resources?

version: "3"
services:

  redis:
    image: 'redis:latest'
    ports:
      - '6379:6379'
    networks:
      - backend
    volumes:
      - data:/data
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    deploy:
      resources:
        limits:
          cpus: '0.1'
          memory: 100M
        reservations:
          cpus: '0.0001'
          memory: 50M
    restart: "on-failure"

  pdf2htmlex:
    image: 'ukwa/pdf2htmlex:latest'
    ports:
      - '5000:5000'
    networks:
      - backend
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    deploy:
      resources:
        limits:
          cpus: '0.1'
          memory: 200M
        reservations:
          cpus: '0.0001'
          memory: 50M
  arxiv:
    image: 'nurtureai/arxivscraper'
    command: 'server'
    ports:
      - '5005:5005'
    networks:
      - backend
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    deploy:
      resources:
        limits:
          cpus: '0.1'
          memory: 200M
        reservations:
          cpus: '0.0001'
          memory: 50M
  nginx:
    environment:
      - "ENVNAME=staging"
      - "APPHost=staging_web"
    image: 'nurtureai/nginx-ssl'
    networks:
      - backend
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - /root/web:/home/app/web
    logging:
      driver: "json-file"
      options:
        max-size: "500k"
        max-file: "50"
    deploy:
      resources:
        limits:
          cpus: '0.2'
          memory: 200M
        reservations:
          cpus: '0.0001'
          memory: 50M

networks:
  frontend:
  backend:

volumes:
  db-data:
  web:
  data:
@surajnarwade
Copy link
Contributor

kompose will simply map your cpu in docker-compose to k8s, it will not consider amount of resources

@u007
Copy link
Author

u007 commented Oct 23, 2017

what is k8s?
so means kompose does not follow cpu and memory limit set in docker compose yml?

@surajnarwade
Copy link
Contributor

@u007 , k8s --> kubernetes, kompose does follow docker compose yml only,

if you check generated deployment for your redis service:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.3.0 (HEAD)
  creationTimestamp: null
  labels:
    io.kompose.service: redis
  name: redis
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: redis
    spec:
      containers:
      - image: redis:latest
        name: redis
        ports:
        - containerPort: 6379
        resources:
          limits:
            cpu: 100m
            memory: "104857600"
          requests:
            memory: "52428800"
        volumeMounts:
        - mountPath: /data
          name: data
      restartPolicy: Always
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: data
status: {}

cpu and memory are exactly mapped

@u007
Copy link
Author

u007 commented Oct 23, 2017

is this gcloud issue?

@cdrage
Copy link
Member

cdrage commented Oct 26, 2017

@u007 most likely your gcloud instance has smaller CPU than your local instance. I'd increase the amount of CPU you're using on gcloud and see what happens.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 24, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 23, 2018
@surajnarwade
Copy link
Contributor

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 6, 2018
@cdrage cdrage closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants