Replies: 4 comments 3 replies
-
I would suggest to rename your issue: "Deploy apps over a cluster possible?" |
Beta Was this translation helpful? Give feedback.
-
CasaOS was designed to support this - that's why we insist on HTTP based API instead of UNIX Domain Socket, so services like AppManagement could be controlled remotely. However, there is just a lack of resource in moving toward this direction. Would love to see 3rd party projects from this community to manage multiple CasaOS instances across a cluster. |
Beta Was this translation helpful? Give feedback.
-
To create a module for CasaOS that sets up and utilizes a Docker Swarm for load balancing and optimization, we need to:
Here is a high-level plan and the necessary steps to create the module: 1. Understand CasaOS and Its ArchitectureCasaOS is a simple, open-source home server OS. It is designed to be easy to use and deploy, with support for various applications through Docker containers. The core components and typical file structure of CasaOS need to be reviewed to ensure compatibility. 2. Docker Swarm SetupDocker Swarm is a native clustering and scheduling tool for Docker containers. It turns a pool of Docker hosts into a single, virtual Docker host. Below are the steps to initialize and manage a Docker Swarm:
3. Integration with CasaOSEnsure that the module integrates with CasaOS's existing functionality. This involves understanding how CasaOS handles Docker containers and aligning our implementation with its processes. 4. Node ManagementProvide a straightforward interface to add new nodes to the Swarm. This can be done through scripts or a web interface, depending on how CasaOS handles user interactions. 5. Service ManagementEnsure that all Docker services (applications) are deployed using the Swarm. This involves modifying deployment scripts to use Docker Swarm commands. Implementation StepsStep 1: Initialize Docker SwarmCreate a script to initialize the Docker Swarm. #!/bin/bash
# Initialize Docker Swarm
docker swarm init
# Output the join token to add worker nodes
docker swarm join-token worker -q > /mnt/data/swarm_worker_token.txt Step 2: Add Nodes to the SwarmCreate a script to add new nodes to the Swarm. #!/bin/bash
# Get the join token from the manager node
SWARM_JOIN_TOKEN=$(cat /mnt/data/swarm_worker_token.txt)
# Join the node to the Swarm
docker swarm join --token $SWARM_JOIN_TOKEN <manager-ip>:2377 Step 3: Deploy Services on the SwarmModify existing deployment scripts to use Example: #!/bin/bash
# Create a Docker service
docker service create --name <service-name> --replicas 3 <image-name> Step 4: Integrate with CasaOSModify the CasaOS source code to call these scripts during the initialization and management of Docker containers. // Example Go code to call the initialization script
package main
import (
"os/exec"
"log"
)
func initSwarm() {
cmd := exec.Command("/path/to/init-swarm.sh")
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
func addNode() {
cmd := exec.Command("/path/to/add-node.sh")
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
func main() {
initSwarm()
// Add more logic as needed
} File Structure
Summary
These scripts and modifications should be in line with CasaOS policies and procedures. Ensure to test thoroughly in a development environment before submitting to the developers. The above scripts and instructions are just a starting point. Depending on the actual implementation details of CasaOS, further refinements might be necessary. Is this the kind of starting point that may be needed? |
Beta Was this translation helpful? Give feedback.
-
Not yet... I have 10+ Raspberry Pi 5 just waiting to beta this...
David D Stanton
*Nonpareil*
דייוד ד סטאנטון
Scientia, prudentia, sapientia, et humilitate
ידע, זהירות, חוכמה וענווה
בס״ד
…On Wed, Aug 7, 2024 at 5:32 PM brandonmnz ***@***.***> wrote:
did anyone try to get this working?
—
Reply to this email directly, view it on GitHub
<#1803 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVF3FKHB4OWAL6BXWDYKSLZQJDZ7AVCNFSM6AAAAABHW3OSC6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMRWGY3TSNI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Greetings I now have 2 Zimaboards and a stack of 9 Raspberry PI 5 and two raspberry pi 4, all of which are running CASAOS, I would love to be able to unify them in one web gui and use them as a unified docker swarm that as I add more devices with casaos that I can add them to the swarm/UI.
Is this doable?
Thoughts?
Thanks!
Armisis
Beta Was this translation helpful? Give feedback.
All reactions