apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.12k stars 1.11k forks source link

request a helm chart, perhaps one for a small setup and one for an ha setup #7298

Open lknite opened 1 year ago

lknite commented 1 year ago
ISSUE TYPE
SUMMARY

Here's my use case: I've got a kubernetes cluster running using xcp-ng, and I want to deploy clusterapi into it to use with deploying new clusters and managing their lifecycle. Apache Cloudstack has a provider that works with clusterapi (and xenserver). So, if I could deploy apache cloudstack into my kubernetes cluster, then I could use its provider... and I suspect, I might use it for a lot more after that.

My environments are all 100% kubernetes, essentially ... so to deploy this out means I'm going to have to build the containers and am looking to not reinvent the wheel, I'm not an apache cloudstack expert after all.

boring-cyborg[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

lknite commented 1 year ago

Working on it ...

$ cat Dockerfile 
FROM quay.io/centos/centos:centos7.9.2009

RUN echo "" && \
  echo "** configuring cloudstack yum repo **" && \
  echo [cloudstack] > /etc/yum.repos.d/cloudstack.repo && \
  echo name=cloudstack >> /etc/yum.repos.d/cloudstack.repo && \
  echo baseurl=http://download.cloudstack.org/centos/7/4.18/ >> /etc/yum.repos.d/cloudstack.repo && \
  echo enabled=1 >> /etc/yum.repos.d/cloudstack.repo && \
  echo gpgcheck=0 >> /etc/yum.repos.d/cloudstack.repo && \
  cat /etc/yum.repos.d/cloudstack.repo && \
  echo "" && \
  echo "** prep for install **" && \
  yum -y install deltarpm && \
  echo "deltarpm=0" >> /etc/yum.conf && \
  echo "" && \
  echo "** installing ps **" && \
  yum -y install procps && \
  echo "** installing some missing libraries**" && \
  yum -y install glibc.i686 && \
  yum -y install libuuid && \
  yum -y install libuuid.so.1 && \
  echo "" && \
  echo "** installing requirements **" && \
  echo "yum -y install supervisor" && \
  yum -y install chrony && \
  yum -y install mysql && \
  yum -y install wget && \
  mkdir -p /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver && \
  wget http://download.cloudstack.org/tools/vhd-util -O /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util && \
  chmod 755 /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util

RUN echo "" && \
  echo "** installing cloudstack **" && \
  yum -y install cloudstack-management

RUN echo "" && \
  echo "** configuring supervisor **" && \
  mkdir -p /etc/supervisor/conf.d && \
  echo [supervisord] > /etc/supervisor/conf.d/supervisord.conf && \
  echo nodaemon=true >> /etc/supervisor/conf.d/supervisord.conf && \
  echo "" >> /etc/supervisor/conf.d/supervisord.conf && \
  echo [program:cloudstack-ui] >> /etc/supervisor/conf.d/supervisord.conf && \
  echo command=/bin/bash -c "npm run serve" >> /etc/supervisor/conf.d/supervisord.conf && \
  echo directory=/root/ui >> /etc/supervisor/conf.d/supervisord.conf && \
  echo stdout_logfile=/dev/stdout >> /etc/supervisor/conf.d/supervisord.conf && \
  echo stdout_logfile_maxbytes=0 >> /etc/supervisor/conf.d/supervisord.conf && \
  echo user=root >> /etc/supervisor/conf.d/supervisord.conf

EXPOSE 8080 8096 5050

ENTRYPOINT ["cloudstack-setup-management"]
$ cat deployment-cloudstack.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cloudstack
  name: cloudstack
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cloudstack
  strategy: {}
  template:
    metadata:
      labels:
        app: cloudstack
    spec:
      containers:
      - image: harbor/cloudstack/cloudstack:latest
        name: cloudstack
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
        command: ['sh', '-c']
        args:
        - cloudstack-setup-databases cloud:password@cloudstack-mysql.cloudstack.svc --deploy-as=root:yIJmQGFks4;
          source /etc/default/cloudstack-management;
          pushd /var/log/cloudstack/management;
          /usr/bin/java $JAVA_DEBUG $JAVA_OPTS -cp $CLASSPATH $BOOTSTRAP_CLASS
$ k get all
NAME                              READY   STATUS    RESTARTS      AGE
pod/cloudstack-mysql-0            1/1     Running   1 (59m ago)   61m
pod/cloudstack-5c9cf98ffc-lck7z   1/1     Running   0             2m34s

NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
service/cloudstack-mysql-headless   ClusterIP   None             <none>        3306/TCP   61m
service/cloudstack-mysql            ClusterIP   10.105.194.238   <none>        3306/TCP   61m
service/cloudstack                  ClusterIP   10.107.69.177    <none>        80/TCP     61m

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/cloudstack   1/1     1            1           61m

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/cloudstack-5c9cf98ffc   1         1         1       2m34s

image

lknite commented 1 year ago

Am I supposed to just install apache cloudstack on the xcp-ng servers themselves? Am I pursuing this all wrong?

DaanHoogland commented 1 year ago

No @lknite you can but you are not supposed to install on a xenserver. If you do so it should be in a virtual machine and not on the dom0 . Your OS for the management server should be one of the supported OSses.

I do think you are going about this wrong though. You should not expect cloudstack to run on top of k8s but vice versa. ACS is supposed to manage you Xens for you and deploy the k8s clusters on them.

telmich commented 11 months ago

I have a question, are there anywhere helm charts for a complete cloudstack-on-kubernetes deployment similar to openstack-helm?

lknite commented 11 months ago

I may have succeeded but upon logging in and trying to configure it I broke everything networking related, so I'm not sure. I was trying to use cloudstack because it supports clusterapi.

When I get back home I'll share what I came up with.

lknite commented 11 months ago

Oh, looks like I built a container and deployed that into my cluster manually... see above. If I had gotten it to work I would have made a helm chart ...

lknite commented 11 months ago

I also thought about deploying cloudstack and using that instead of xenserver, but ended up installing vmware and using that... still open to cloudstack, tricky to get up to speed with it.