eclipse-symphony / symphony

Symphony project
MIT License
27 stars 17 forks source link

Defining cpu using millicores seems doesn't work #70

Closed LeiQL closed 4 months ago

LeiQL commented 4 months ago
apiVersion: solution.symphony/v1
kind: Solution
metadata: 
  name: sample-prometheus-server
spec:  
  metadata:
    deployment.replicas: "#1"
    service.ports: "[{\"name\":\"port9090\",\"port\": 9090}]"
    service.type: "LoadBalancer"
  components:
  - name: sample-prometheus-server
    type: container
    properties:
      container.ports: "[{\"containerPort\":9090,\"protocol\":\"TCP\"}]"
      container.imagePullPolicy: "Always"
      container.resources: "{\"requests\":{\"cpu\":\"100m\",\"memory\":\"100Mi\"}}"        
      container.image: "prom/prometheus"

Issue: 100m will be translated to 100 cpu in existing k8s.provider. Doc: https://github.com/Azure/symphony/blob/d4172fbb2166af16962562dafd919928a8c01bdc/docs/symphony-book/quick_start/deploy_prometheus_k8s.md

Haishi2016 commented 4 months ago

We don't interpret this value ourselves, we just feed the deserialized string as ResourceRequirements.

LeiQL commented 4 months ago

Cannot repro this issue. Container deployed with correct resource requirement.


Containers:
  sample-prometheus-server:
    Container ID:   docker://3ec94c2236442a62d45363b86d8eb331e6a7fb81de2ec02ba745bde243fe736a
    Image:          prom/prometheus
    Image ID:       docker-pullable://prom/prometheus@sha256:beb5e30ffba08d9ae8a7961b9a2145fc8af6296ff2a4f463df7cd722fcbfc789
    Port:           9090/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Wed, 31 Jan 2024 17:28:12 +0800
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:        100m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-bbktl (ro)