Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9803

Closed
Open
Created Nov 04, 2015 by Administrator@rootOwner

How to deploy with marathon ?

Created by: kopax

I am trying to implement the deployment of gitlab-ce with mesos/marathon

Here is the json config file I use :

{
  "id": "/domain/gitlab",
  "apps": [
    {
      "id": "git",
      "cpus": 1,
      "mem": 2048,
      "instances": 1,
      "env": {
          "SERVICE_TAGS": "git,webapp,http,weight=100,haproxy_tcp=22,haproxy_tcp 10080",
          "SERVICE_NAME": "git",

          "TZ":" Europe/Paris",
          "GITLAB_TIMEZONE": "Paris",

          "GITLAB_SECRETS_DB_KEY_BASE": "XEf64Bw45646V31de46554a931C27R5",

          "GITLAB_HTTPS": "false",
          "GITLAB_HTTPS_HSTS_MAXAGE": "2592000",
          "GITLAB_HOST": "git.domain.com",
          "GITLAB_PORT": "10080",
          "GITLAB_SSH_PORT": "22",

          "GITLAB_NOTIFY_ON_BROKEN_BUILDS": "true",
          "GITLAB_NOTIFY_PUSHER": "false",

          "GITLAB_EMAIL": "[email protected]",
          "GITLAB_EMAIL_REPLY_TO": "[email protected]",
          "GITLAB_INCOMING_EMAIL_ADDRESS": "[email protected]",

          "GITLAB_BACKUPS": "daily",
          "GITLAB_BACKUP_TIME": "01:00",

          "REDIS_HOST": "gitlab.redis.domain.com",
          "REDIS_PORT": "6379",

          "DB_NAME": "gitlabhq_production",
          "DB_USER": "git",
          "DB_PASS": "2P9bDZn95B",
          "DB_TYPE": "mysql",
          "DB_HOST": "gitlab.mariadb.domain.com",
          "DB_PORT": "3306",

          "IMAP_ENABLED": "true",
          "IMAP_HOST": "mail.domain.com",
          "IMAP_PORT": "143",
          "IMAP_USER": "[email protected]",
          "IMAP_PASS": "DFA13132",
          "IMAP_SSL": "false",
          "IMAP_STARTTLS": "true",

          "SMTP_ENABLED": "true",
          "SMTP_DOMAIN": "domain.com",
          "SMTP_HOST": "mail.domain.com",
          "SMTP_PORT": "587",
          "SMTP_USER": "[email protected]",
          "SMTP_PASS": "564A132",
          "SMTP_TLS": "false",
          "SMTP_STARTTLS": "true",
          "SMTP_AUTHENTICATION": "cram_md5"
      },
      "constraints": [
          [
              "hostname",
              "CLUSTER",
              "prod-01"
          ]
      ],
      "container": {
          "type": "DOCKER",
          "docker": {
              "image": "sameersbn/gitlab:8.0.3",
              "network": "BRIDGE",
              "portMappings": [
                  {
                      "containerPort": 10080,
                      "hostPort": 0,
                      "servicePort": 10080,
                      "protocol": "tcp"
                  },
                  {
                      "containerPort": 22,
                      "hostPort": 0,
                      "servicePort": 22,
                      "protocol": "tcp"
                  }
              ]
          },
          "volumes": [
              {
                "containerPath": "/home/git/data/backups",
                "hostPath": "/srv/backup/gitlab",
                "mode": "RW"

              },
              {
                "containerPath": "/home/git/data",
                "hostPath": "/srv/docker/gitlab",
                "mode": "RW"
              }
             ]
           },
          "uris": [
              "file:///etc/docker.tar.gz"
          ]
    }
  ],
  "groups": [
    {
      "id" : "db",
      "apps":[
        {
          "id": "mariadb",
          "cpus": 1,
          "mem": 2048,
          "instances": 1,
          "env": {
              "SERVICE_TAGS": "gitlab.mariadb,haproxy_tcp=3306",
              "SERVICE_NAME": "gitlab_mariadb",
              "MYSQL_ROOT_PASSWORD": "GXXXXsssL",
              "MYSQL_USER": "git",
              "MYSQL_PASSWORD": "PXXsXX5B",
              "MYSQL_DATABASE": "gitlabhq_production",
              "TERM": "dumb"
          },
          "constraints": [
              [
                  "hostname",
                  "CLUSTER",
                  "prod-01"
              ]
          ],
          "container": {
              "type": "DOCKER",
              "docker": {
                  "image": "mariadb",
                  "network": "BRIDGE",
                  "portMappings": [
                      {
                          "containerPort": 3306,
                          "hostPort": 0,
                          "protocol": "tcp"
                      }
                  ]
              },
              "uris": [
                  "file:///etc/docker.tar.gz"
              ],
              "healthChecks": [
                  {
                      "portIndex": 0,
                      "protocol": "TCP",
                      "gracePeriodSeconds": 30,
                      "intervalSeconds": 10,
                      "timeoutSeconds": 30,
                      "maxConsecutiveFailures": 3
                  }
              ]
          }
        },
        {
          "id": "redis",
          "cpus": 0.2,
          "mem": 512,
          "instances": 1,
          "env": {
              "SERVICE_TAGS": "gitlab.redis,haproxy_tcp=6379",
              "SERVICE_NAME": "gitlab_redis"
          },
          "constraints": [
              [
                  "hostname",
                  "CLUSTER",
                  "prod-01"
              ]
          ],
          "container": {
              "type": "DOCKER",
              "docker": {
                  "image": "sameersbn/redis:latest",
                  "network": "BRIDGE",
                  "portMappings": [
                      {
                          "containerPort": 6379,
                          "hostPort": 0,
                          "protocol": "tcp"
                      }
                  ]
              },
              "uris": [
                  "file:///etc/docker.tar.gz"
              ],
              "healthChecks": [
                  {
                      "portIndex": 0,
                      "protocol": "TCP",
                      "gracePeriodSeconds": 30,
                      "intervalSeconds": 10,
                      "timeoutSeconds": 30,
                      "maxConsecutiveFailures": 3
                  }
              ]
          }
        }
      ]
    }
  ]
}

I really can't get it work, after the creation of git container, log complain about the already existing database gitlabhq_production

If I delete it from inside the container, and restart the git app, the log get stuck to :

debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.

If I login into the container and restore a previous backup, doesn't work either.

Does anyone have ever tried with marathon ?

Assignee
Assign to
Time tracking