Skip to content

⚙️ Configuration ​

Mars reads a single YAML file for all its settings: config.yaml in the directory you run it from. Generate one with ./bin/app init, then edit it and restart Mars for changes to take effect.

This page explains the settings you're most likely to touch. A full commented template lives at config_example.yaml in the repository.

Core settings ​

SettingDefaultWhat it does
app_port4000The web address users open: http://<host>:4000
grpc_port50000Internal API port (most users don't touch this)
admin_password123456Password for the built-in admin account — change it!

Connecting your Git server ​

Set git_server_plugin so Mars can read your repositories and charts:

yaml
git_server_plugin:
  name: gitlab
  args:
    token: "your-gitlab-token"
    baseurl: "https://gitlab.com/api/v4"

To create a GitLab token: GitLab → Settings → Access Tokens → Add new token, and give it at least read_api scope. Use your self-hosted GitLab address in baseurl if you have one.

Connecting your Kubernetes cluster ​

Point Mars at your cluster's kubeconfig. If Mars runs on the same machine as kubectl, you usually already have this file:

yaml
kubeconfig: "/home/you/.kube/config"
  • Running Mars inside the cluster? Leave it empty — Mars uses the in-cluster credentials automatically.
  • Running outside? Point it at your kubeconfig file.

Mars adds a prefix to every namespace it creates — ns_prefix (default devops-). You can change it if that prefix clashes with your cluster.

Sign-in ​

Password login ​

Works out of the box with admin and admin_password. When users log in with the admin account, they get full permissions (see Permissions).

Single sign-on (OIDC) ​

To let people log in with their company account, add one or more OIDC providers:

yaml
oidc:
  - name: "company-sso"
    enabled: true
    provider_url: "https://sso.company.com"
    client_id: "mars"
    client_secret: "xxxx"
    redirect_url: "http://127.0.0.1:3000/auth/callback"

You can configure several providers — users can pick which one to sign in with.

Private image registry ​

To pull images from a private Docker registry, list the credentials:

yaml
imagepullsecrets:
  - username: "registry-user"
    password: "registry-password"
    email: "you@example.com"
    server: "registry.example.com"        # default: https://index.docker.io/v1/

Mars attaches these credentials to deployed applications so they can pull private images.

Storage ​

Mars stores its own data (namespaces, projects, deploy history) in a database.

SettingDefaultNotes
db_driversqlitesqlite needs no setup; mysql for production
db_database/tmp/mars-sqlite.dbfile path for sqlite; database name for mysql
db_host / db_port / db_username / db_password—required only for mysql

File uploads ​

SettingDefaultNotes
upload_dir/tmp/mars-uploadswhere uploaded files are stored
upload_max_size50mmaximum upload size (e.g. 100m, 1g)
s3_enabledfalsestore uploads on S3 / MinIO instead of disk

Small niceties ​

SettingDefaultWhat it does
picture_pluginpicture_bingbackground image on the login page: picture_bing or picture_cartoon
external_ip127.0.0.1externally reachable IP of your cluster
install_timeout90show long a deployment may take before timing out
debugfalseverbose logs for troubleshooting

Command line ​

CommandWhat it does
./bin/app initgenerate a config.yaml if one doesn't exist
./bin/app serve -c config.yamlstart the server
./bin/app inspectshow runtime info (config, plugins, jobs…)

Common flags for serve:

bash
./bin/app serve -c config.yaml \
  --app_port 4000 \
  --grpc_port 50000 \
  --metrics_port 9091 \
  --kubeconfig ~/.kube/config