Ship is a simple stack/service manager for Kubernetes/Docker Swarm. It allows for example: Development teams to deploy new image version to a Kubernetes or Docker Swarm Cluster. Developers are then also able to see the logs for either the deployment/service or connected pods/tasks for easy debugging.
It also provides an option to scale deployments/services and force re-deploy deployments/services.
Make sure you have Node.JS 16.x installed then run the following commands in your terminal:
npm ci
npm run tailwind
npm run dev
Please note that not all functions are available when running locally. Some functions are only available on a docker swarm instance when running in swarm mode
Ship is available for your own kubernetes cluster. Follow the guide below to install the app onto your own cluster:
We recommend you to use an ingress controller like Traefik or Nginx in front of Ship
Please note that right now Ship does not have built-in user management! So don't open up Ship to the outside world unless you are using for example an IP Whitelist
Helm must be installed to use the ship chart. Please refer to Helm's documentation to get started.
Once Helm has been set up correctly, add the repo as follows:
helm repo add glenndehaan https://glenndehaan.github.io/charts
If you had already added this repo earlier, run helm repo update
to retrieve the latest versions of the packages.
You can then run helm search repo glenndehaan
to see the charts.
To install the ship chart:
helm install ship glenndehaan/ship
You can refer to the values.yaml
to customize the deployment:
https://github.com/glenndehaan/charts/blob/master/charts/ship/values.yaml
Ship is available for your own docker swarm cluster. Follow the guide below to install the app onto your own cluster:
We recommend you to use a reverse proxy like Traefik or Nginx in front of Ship
Please note that right now Ship does not have built-in user management! So don't open up Ship to the outside world unless you are using for example an IP Whitelist
- Create a ship-stack.yml file with the following contents:
version: '3.8'
services:
ship:
image: glenndehaan/ship:latest
deploy:
labels:
# Example headers for the traefik v2 reverse proxy
- traefik.enable=true
- traefik.http.routers.ship.entrypoints=websecure
- traefik.http.routers.ship.rule=Host(`ship.example.com`)
- traefik.http.routers.ship.tls=true
- traefik.http.services.ship.loadbalancer.server.port=3000
placement:
constraints:
- node.role == manager
environment:
# Can be used to hide specific services from the ship overview page
HIDDEN_SERVICES: 'ship_ship,ship_ship-agent'
# Defines the maximum allowed scale. This means you can't scale a service with more containers then this amount
MAX_SCALE: '20'
# Can be used to instruct Ship to use an SSO providers username header
# AUTH_HEADER: ''
# Can be used to enable custom webhooks to forward Ship events to other services
# CUSTOM_WEBHOOK: 'https://webhook1.example.com/hook,https://webhook2.example.com/hook'
# Can be used to enable slack notifications whenever an action on ship is performed
# SLACK_WEBHOOK: ''
# Can be used to enable email notifications whenever an action on ship is performed
# EMAIL_SMTP_HOST: 'smtp.example.com'
# EMAIL_SMTP_PORT: '25'
# EMAIL_SMTP_SECURE: 'false'
# EMAIL_FROM: '[email protected]'
# EMAIL_TO: '[email protected],[email protected]'
# Can be used to disable service modifications during specific days/times
# LOCKOUT_EXCEPTIONS: '[email protected]' # Specifies usernames who can bypass the lockout rules
# LOCKOUT_SERVICE_REGEX: '.*-live' # Specifies which services are affected by the lockout rules
# LOCKOUT_DAYS: '0,5,6' # Disallow specific days: 0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
# LOCKOUT_AFTER_HOUR: '' # Disallow modifications after a specified hour, note: we are using the UTC timezone
# Can be enabled to include debug data as JS window parameters
# DEBUG_DOCKER: 'true'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/ship_data:/data
ship-agent:
image: glenndehaan/ship-agent:latest
deploy:
mode: global
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- Run
docker stack deploy -c ship-stack.yml ship
this pulls ship and starts it on the docker swarm
Ship can forward events to other services through the help of webhooks (POST Request). Below you will find an example payload of what you can expect:
{
"type": "force_update",
"username": "Anonymous",
"service": "test_test",
"params": {},
"time": 1651821585213
}
Below are some options that get send with different events:
{
"type": "attempt_update | update | attempt_force_update | force_update | attempt_scale | scale | attempt_restore | restore",
"username": "Anonymous | Authenticated User Email/Username",
"service": "stack_service",
"params": {
image: "library/repo", // Only gets send with type: update
old_image_version: "latest | tag", // Only gets send with type: update
new_image_version: "latest | tag" // Only gets send with type: update
},
"time": 0
}
MIT