Gitlab部署
创建参数配置文件
core:
env:
OAUTH_ENABLED: false
OAUTH_AUTO_SIGN_IN_WITH_PROVIDER: "oauth2_generic"
OAUTH_ALLOW_SSO: "'oauth2_generic'"
OAUTH_BLOCK_AUTO_CREATED_USERS: false
OAUTH_GENERIC_API_KEY: "gitlabhq"
OAUTH_GENERIC_APP_SECRET: "gitlabhq"
# choerodon api 访问地址
OAUTH_GENERIC_SITE: "http://api.example.choerodon.io"
OAUTH_GENERIC_USER_INFO_URL: "/oauth/api/user"
OAUTH_GENERIC_AUTHORIZE_URL: "/oauth/oauth/authorize"
OAUTH_GENERIC_TOKEN_URL: "/oauth/oauth/token"
OAUTH_GENERIC_ROOT_PATH: "'userAuthentication','principal'"
OAUTH_GENERIC_USER_NICKNAME: "username"
OAUTH_GENERIC_USER_NAME: "username"
RACK_ATTACK_WHITELIST: 0.0.0.0/0
redis:
internal:
password: password
persistence:
enabled: true
persistentVolumeClaim:
core:
storageClass: nfs-provisioner
redis:
storageClass: nfs-provisioner
database:
storageClass: nfs-provisioner
expose:
ingress:
host: "gitlab.example.choerodon.io"
database:
internal:
password: "password"
执行安装
参数
访问设置的Gitlab域名出现以下界面即部署成功
执行更新
- 在执行里面前请根据实际情况修改参数
web_server_redirect_uri
编写参数配置文件
gitlab-client.yaml
env:
MYSQL_HOST: c7n-mysql.c7n-system.svc
MYSQL_PASS: password
MYSQL_PORT: 3306
MYSQL_USER: root
SQL_SCRIPT: |
INSERT INTO hzero_platform.oauth_client (name,organization_id,resource_ids,secret,scope,authorized_grant_types,web_server_redirect_uri,access_token_validity,refresh_token_validity,additional_information,auto_approve,object_version_number,created_by,creation_date,last_updated_by,last_update_date,enabled_flag,time_zone)VALUES('gitlabhq',1,'default','gitlabhq','default','password,implicit,client_credentials,authorization_code,refresh_token','http://gitlab.example.choerodon.io',3600,3600,'{}','default',1,0,NOW(),0,NOW(),1,'GMT+8');
执行完添加管理员用户关联步骤前请不要去Gitlab界面进行登录操作
执行下面语句进行关联:
helm upgrade --install gitlab-user-identities c7n/postgresql-client \
--set env.PG_HOST=gitlabhq-gitlab-database.c7n-system.svc \
--set env.PG_PORT=5432 \
--set env.PG_USER=gitlab \
--set env.PG_PASS=changeit \
--set env.PG_DBNAME=gitlabhq_production \
--set env.SQL_SCRIPT="\
INSERT INTO identities(extern_uid\, provider\, user_id\, created_at\, updated_at) \
VALUES ('2'\, 'oauth2_generic'\, 1\, NOW()\, NOW());" \
--version 0.1.0 \
访问设置的Gitlab域名出现以下界面即更新成功