Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thealpha16/phoros
A lightweight go server to host files in k8s environment
https://github.com/thealpha16/phoros
file-server go-api kubernetes s3-compatible
Last synced: 27 days ago
JSON representation
A lightweight go server to host files in k8s environment
- Host: GitHub
- URL: https://github.com/thealpha16/phoros
- Owner: TheAlpha16
- License: gpl-3.0
- Created: 2024-10-13T15:14:46.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-18T20:10:16.000Z (3 months ago)
- Last Synced: 2024-11-05T03:04:25.771Z (2 months ago)
- Topics: file-server, go-api, kubernetes, s3-compatible
- Language: Go
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phoros
phoros is a Kubernetes-native, lightweight file server written in Go. It is designed to be scalable and efficient, capable of serving files with redundancy and persistent storage. Initially developed for use in CTF environments, phoros can be easily decoupled and used as a standalone solution. It integrates with Kubernetes and supports both native file storage and S3-compatible object storage (S3 support coming in the next release).
## Features
- **Lightweight & Efficient:** Optimized for minimal resource usage while handling file storage and transfer.
- **Kubernetes-Native:** Built specifically for Kubernetes environments, with easy deployment and configuration.
- **Helm Charts:** For easy configuration and deployment.
- **Scalable:** Supports autoscaling based on CPU/memory utilization.
- **Storage Options:** Native or S3-compatible object storage.
- **Traefik Proxy Integration:** Traefik proxy support for TLS certificates and external access through Kubernetes Ingress.## Architecture
phoros is designed to run within a Kubernetes cluster. By default, it exposes a file server at a container port `9049` and can be configured to use a Kubernetes service to expose the server internally or externally. For external access, phoros leverages a Traefik proxy for TLS termination and ingress management.
## Getting Started
### Prerequisites
- Kubernetes Cluster
- Helm (for deployment)
- (Optional) S3-compatible object store (future release)### Installation
1. Clone the repository:
```bash
git clone https://github.com/TheAlpha16/phoros.git
cd phoros
```2. Customize the configuration by modifying the `values.yaml` file or by passing parameters during installation
3. Install phoros using Helm:
```bash
helm install phoros ./helm
```4. Access phoros:
- If ingress is enabled and properly configured, access phoros using the defined host (e.g., `https://example.com/files`).
- If ingress is disabled, use the internal Kubernetes service (default type: `ClusterIP`).## Usage
### Storage Configuration
You can choose between native file storage and S3-compatible object storage by setting the `objectStore` variable in the Helm `values.yaml` file.
- **Native Storage**:
```yaml
storage:
objectStore: native
```- **S3-Compatible Storage** (available in future releases):
```yaml
storage:
objectStore: s3
```## Configuration
phoros uses a `values.yaml` file for configuration. Below is a summary of the key configurable options:
- **Namespace**: Specify the Kubernetes namespace where phoros will be installed.
- **Event Timings**: Configure event start and end times if running phoros in a timed environment (e.g., CTFs).
- **Storage**: Define the storage class, access mode, and size. Choose between `native` or `s3` for the object store.
- **Secrets**: Set secrets for session management and admin access.
- **Service Type**: Specify the Kubernetes service type (`ClusterIP`, `NodePort`, or `LoadBalancer`).
- **Ingress**: Enable or disable ingress and define the host and paths.
- **Autoscaling**: Configure autoscaling parameters based on CPU/memory utilization.For detailed configuration, check the [Helm `values.yaml`](./helm/phoros/values.yaml) file.
### Example `values.yaml`
```yaml
replicaCount: 1
namespace: phorosevent:
startTime: 1729191091
endTime: 1729291091
postEvent: falsestorage:
storageClass: do-block-storage
accessMode: ReadWriteOnce
size: 1Gi
objectStore: native
mountPath: /etc/phorossecrets:
sessionSecret: your-session-secret
adminSecret: your-admin-secretservice:
type: LoadBalancer
containerPort: 9049
servicePort: 80ingress:
enabled: true
host: "example.com"
paths:
- /files
- /pingautoscaling:
enabled: false
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
```## Contributing
Feel free to contribute to phoros by opening issues or submitting pull requests.
## Roadmap
- Add S3-compatible object storage support.
- Add tls support## License
This project is licensed under the GNU General Public License.