kiranchavala opened a new issue, #51:
URL: https://github.com/apache/cloudstack-kubernetes-provider/issues/51

   ISSUE TYPE
   
    * Enhancement request
   
   
   COMPONENT NAME
   
   Component: Kubernetes/Networking
   
   CLOUDSTACK VERSION
   
   Cloudstack 4.18
   
   SUMMARY
   
   Support static public ip address as a Load balancer IP
   
   
   STEPS TO REPRODUCE
   
   1. Deploy Kubernetes cluster on Cloudstack 
   
   2. Create a deployment for example a nginx deployment 
   
   ```
   
   
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: nginx-deployment
   spec:
     selector:
       matchLabels:
         app: nginx
     replicas: 2 # tells deployment to run 2 pods matching the template
     template:
       metadata:
         labels:
           app: nginx
       spec:
         containers:
         - name: nginx
           image: nginx:1.14.2
           ports:
           - containerPort: 80
   
   ```
   
   
   3. Expose the deployment as a loadbalancer service 
   
   `kubectl expose deploy/nginx-deployment --port=80 --type=LoadBalancer`
   
   
   4. Cloudstack then randomly allocated a public ip as  external ip 
   
   ```
   ❯ kubectl get svc nginx-deployment
   NAME               TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)       
 AGE
   nginx-deployment   LoadBalancer   10.109.88.98   10.0.54.83    80:32739/TCP  
 4m24s
   
   ```
   
   
   5. Suppose a user wants a specific public ip as a loadbalancer ip 
   
   Currently it's not possible even if we manually edit the service.yaml, 
cloudstack again allocates a random public ip 
   
   ```
   apiVersion: v1
   kind: Service
   metadata:
     creationTimestamp: "2023-07-25T04:31:03Z"
     finalizers:
     - service.kubernetes.io/load-balancer-cleanup
     name: nginx-deployment
     namespace: default
     resourceVersion: "995303"
     uid: 224691be-fa86-4b07-938c-c86d948b99fb
   spec:
     allocateLoadBalancerNodePorts: true
     clusterIP: 10.109.88.98
     clusterIPs:
     - 10.109.88.98
     externalTrafficPolicy: Cluster
     internalTrafficPolicy: Cluster
     ipFamilies:
     - IPv4
     ipFamilyPolicy: SingleStack
     ports:
     - nodePort: 32739
       port: 80
       protocol: TCP
       targetPort: 80
     selector:
       app: nginx
     sessionAffinity: None
     type: LoadBalancer
   status:
   apiVersion: v1
     loadBalancer:
   apiVersion: v1
       ingress:
       - ip: 10.0.54.83
   ```
   
   
   EXPECTED RESULTS
   
   Cloudstack should allocate the specified public ip address 
   
   
   ACTUAL RESULTS
   
   Clodudstack is allocating a radom public ip address 
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to