Assuming here that you have a Kubernetes cluster just for staging purpose, you will need to install the controller used to manage all resources needed.
We are currently developing a helm chart to make installation easy. Currently, this pre-release step requires a manual deployment of the controller.
Creating Kubernetes Deployment
Modify and apply this YAML file to your needs:
apiVersion:apps/v1kind:Deploymentmetadata:name:manystagingslabels:run:manystagingsspec:replicas:1selector:matchLabels:run:manystagingstemplate:metadata:labels:run:manystagingsspec:containers:-name:manystagingsimage:carlosstrand/manystagings:latestports:-containerPort:8000env:-name:"DB_TYPE"value:# Add a database type (postgres, mysql, sqlite)-name:"DB_URI"value:# Add DB_URI-name:"KUBERNETES_KUBECONFIG_BASE64"value:# Add a KUBECONFIG file encoded in base64. This kubeconfig is shared between all developers with access to ManyStagings-name:"SESSION_SECRET"value:# Add a random session token here. It's used to manage the auth sessions---apiVersion:v1kind:Servicemetadata:name:manystagingslabels:run:manystagingsspec:ports:-port:80targetPort:8000protocol:TCPselector:run:manystagings---apiVersion:networking.k8s.io/v1beta1kind:Ingressmetadata:annotations:kubernetes.io/ingress.class:"nginx"cert-manager.io/cluster-issuer:"letsencrypt-prod"name:manystagingsspec:rules:-host:ms.yoursite.comhttp:paths:-backend:serviceName:manystagingsservicePort:80path:/tls:-hosts:-ms.yoursite.comsecretName:manystagings-tls-secret
Environment Variables
Key
Description
DB_TYPE
Define the type of the database. Possible values: postgres, mysql, sqlite
DB_URI
KUBERNETES_KUBECONFIG_BASE64
A Kubeconfig file used to manage the K8s. (Note: currently it is shared between CLI clients)
SESSION_SECRET
A session secret used to manage session
Configuring Staging Environments
After install the controller you may be able to access the URL. https://ms.yoursite.com
When accessing this URL, you will see a login screen. The default user/password is root/root but you can change in settings.
Now, it's time to configure your applications like Database, API, etc:
The Web UI is very simple and intuitive. It follows almost all the concepts of an application in Docker, for example. You need to configure the images, environment variables and ports. Behind the scenes, ManyStagings will manage the Kubernetes and create the resources you have configured
Installing CLI
Through the CLI, all developers will be able to manage their own staging environment.
To do this, have Go 1.16.2 installed and run: