Development
In this article:
Development#
General information#
The GitLab cloud PaaS service for development management allows you to quickly deploy a full-featured DevOps platform in the cloud to manage the software development life cycle (SDLC). Infrastructure preparation and platform deployment are automated and take just a few minutes.
GitLab combines repository management tools, CI/CD automation, monitoring, and code security tools. It allows you to centralize the planning, development, and deployment of software products and ensure transparent teamwork for developers, DevOps engineers, and system administrators.
K2 Cloud supports the open-source GitLab CE (Community Edition). This edition has all the functionality required to support DevOps, including repository management, CI/CD, merge requests, and issue and user management. If you do not need advanced security and management features, this option is optimal.
Billing#
You pay for actually consumed billable resources: instances, volumes, Elastic IP addresses, and other resources.
Before you begin#
We recommend that you first read the recommendations on working with the GitLab service.
Required privileges#
To work with the GitLab service, a user needs to have PaaSFullAccess project privileges. For instance, administrators in the CloudAdministrators group have such privileges. If necessary, you can create a separate user, add the user to the project, and either attach the PaaSFullAccess policy to the user or add the user to the cloud administrators group in this project.
The PaaSFullAccess project privileges grant the user permissions for all actions with all PaaS services. To allow the user only particular actions with the GitLab service, create a policy with the appropriate privileges and assign it to the user. For details, see the IAM documentation on how to create a policy and assign it to the user.
Required resources#
To deploy the GitLab service, the project must have the following resources:
Launching the GitLab service#
To launch the service, go to the Service store or Running services subsection, select the GitLab service in the Development tab, and click Create.
Important
The GitLab service can be launched only in a subnet with internet access. To configure access, you may need to attach an internet gateway to the VPC and create a default route in the route table.
The service launch procedure comprises the following stages:
Set the network parameters required for the GitLab service:
Note
To launch the service in the selected VPC, you must first create a subnet in the preferred availability zone.
Note
The ability to attach network interfaces may be useful, for example, when you need to recreate the node where the GitLab service was deployed. If you do not delete the attached network interface when deleting the service, you can reuse it to connect the node of the new service to the subnet. This allows you to retain the previous network settings, such as the private IP address and security groups, rather than configure them again.
Configuration of the cluster where the service will be deployed. Only the configuration with one master node (service without high availability) is available.
VPC where the GitLab service will be deployed.
Security groups to control traffic on the interfaces of the instance where the GitLab service will run.
Important
To ensure the correct operation of the GitLab service, a new security group is automatically created together with it. It includes the following rules:
the rule to permit inbound traffic from interfaces that are in the same security group;
the rule to enable all outbound IPv4 traffic.
(if an internet-facing load balancer is selected) the rule to permit inbound HTTP traffic on port 80.
If the GitLab service is deleted, this security group will also be deleted.
Subnet to which an instance with the service deployed on it will be attached, or network interface by which this instance will be attached to the subnet.
Internet-facing load balancer.
Note
If you plan to use HTTPS to access GitLab, select this option. A TLS certificate from Let’s Encrypt will be issued for the load balancer domain name (for details, see external access support).
In the DNS name field, you can specify an arbitrary subdomain name in the <lb-name>-<lb-id>.lb.<region>.k2.cloud DNS service zone for the load balancer. The name may contain Latin letters, digits, and hyphens.
If the DNS name field is left blank, the name will be specified automatically.
Click Next to proceed to the next step.
In the Master node block, configure the instance to be used as the master node. To do this, select the instance type and data volume parameters: type, size, and IOPS (if available for this type). The system volume will be added automatically.
Note
The GitLab service performance depends on the choice of master node components. We recommend using an instance with a large amount of RAM.
Click Next to proceed to the next step.
Set the main service parameters:
Service name — an arbitrary unique name for the service. The name must consist of lowercase Latin letters, digits, and the
.and-characters, begin with a letter, and meet the requirements for domain names.The
rootuser password for initial access to GitLab. It can be set manually or generated automatically.Note
We recommend changing the password in the GitLab interface after the service is created.
Whether to enable Container Registry to store Docker images of applications. If you select this option, specify the type of storage where the images will be stored:
file system— images will be stored on the data volume;object storage— images will be stored in an object storage bucket.
If you select object storage, also specify:
a user with PaaSBackupPolicy privileges on whose behalf images are written to the bucket (the user must not have any other privileges);
the bucket where the images will be stored.
Whether to enable logging. For centralized logging of the GitLab service, first create an ELK logging service. Once a PaaS service is created, you will be able to install logging agents manually only.
Logging service – The selection of a logging service is only available when the Enable logging checkbox is checked.
Logging tags – Tags are assigned to logs when the latter are imported by the logging service. They simplify search for the required logs. Tags can only be set when the Enable logging checkbox is checked.
Whether to enable monitoring. For centralized monitoring of the GitLab service, first create a Prometheus monitoring service.
Monitoring service – The selection of a monitoring service is only available when the Enable monitoring checkbox is checked.
Monitoring labels — Optionally, you can set monitoring labels, which the installed monitoring agents will assign to the collected metrics (for details, see Using labels). Labels can only be set when the Enable monitoring checkbox is selected.
Click Next to proceed to the next step.
Set the maintenance window (see Configuring the maintenance window). If scheduled maintenance can be performed at any time, leave the Maintenance window option set to
Custom. If there are time restrictions when maintenance can be performed, select the interval that is convenient for you. To do so, specify the following parameters:the
Scheduledvalue for the Maintenance window option;a day of the week for the maintenance to take place;
hour interval for the maintenance window.
To add tags to the service, click Add tags.
To add a tag, click Add tag and enter tag key and value.
Note
If no tags have been set yet, you can add the Name tag by clicking Add Name tag and specifying its value.
When done, click Create to launch the service.
Important
The GitLab service launch usually takes 5 to 15 minutes.
Modifying service node options#
Modify the instance type for the node#
You can modify the instance type for cluster nodes running the development service. You can do it only when the service is in the Ready state.
Go to PaaS Running services and open the Development tab.
Find the desired service in the table and click the service ID to go to its page.
In the Information tab, edit the Instance type field in the configuration section of master node. To do this, click the edit icon and selecting the instance type.
Click to save changes.
Modify data volume parameters#
You can only change the data volume parameters when the service is in the Ready state.
You can configure the data volume size and its performance in IOPS right from the cloud web interface.
Important
You can change IOPS only for a data volume of the type io2.
To change the volume parameters, follow these steps:
Go to PaaS Running services and open the Development tab.
Find the desired service in the table and click the service ID to go to its page.
In the Information tab, edit the required fields (Data volume size and/or Data volume IOPS) by clicking the edit icon .
Important
The new data volume size must exceed the current one.
Click to save changes.
Configuring the GitLab service#
If you have not enabled monitoring and/or logging when creating the GitLab service, or you want to disable them, you can do it only when the service is in the Running state.
Note
To enable monitoring and logging, first deploy Prometheus-based monitoring service and ELK-based logging service.
In addition, you can configure the image registry (Container Registry) parameters and specify settings for email notifications and authentication via OIDC and/or LDAP.
Important
If an attempt to modify some settings fails, then the service will be reset to default ones.
To configure the GitLab service parameters:
Go to PaaS Running services and open the Development tab.
Find the desired service in the table and click the service ID to go to its page.
Open the Parameters tab and click Modify.
In the window that opens, you can enable or configure monitoring, logging, Container Registry, SMTP, OIDC, and LDAP (or disable them if they are already enabled).
When enabling Container Registry, specify the following parameters:
Storage type — If you select File system, images will be stored on the data volume. If you select Object storage, images will be stored in an object storage bucket.
For the Object storage type, specify:
a user with PaaSBackupPolicy privileges on whose behalf images are written to the bucket (the user must not have any other privileges);
the bucket where the images will be stored.
When enabling SMTP, specify:
SMTP settings
SMTP server address — IP address or FQDN of the mail server. If no server is specified, the local MTA is used to send mail.
SMTP server port — The port the mail server runs on (usually 25, 465, or 587).
SMTP user name — User name for authentication on the mail server. If no name is specified, authentication is not used.
SMTP password — User password for authentication on the mail server. If no password is specified, authentication is not used.
SMTP domain — Mail domain name.
SMTP authentication method — The authentication method supported by the mail server. If you select
plain, the name and password are sent as plain text. If authentication is not used, the parameter does not need to be passed.Use TLS immediately — Whether TLS encryption should be used immediately when connecting to the mail server. If the server listens on port 465, the client is usually required to use TLS immediately when connecting. If the server listens on port 25 or 587, an unencrypted connection is usually established first and then upgraded to encryption using the STARTTLS mechanism.
Enforce TLS — (Only if Use TLS immediately is disabled) Encryption must be supported from the start of communication with the mail server. If the server does not support TLS, the connection is terminated immediately.
Enable STARTTLS automatically — (Only if Use TLS immediately is disabled) When connecting to the mail server, GitLab will try to establish an encrypted connection using the STARTTLS mechanism. If the server does not support TLS, communication will continue without encryption.
TLS certificate verification mode — If you select
peer, the certificate validity is verified. If you selectnone, no verification is performed (for example, for self-signed certificates).Sender address — Sender address for all outgoing mail.
Reply-to address — Address for email replies.
When enabling OIDC, specify:
OIDC settings
Button name — Text to be displayed on the login button in the GitLab interface. If the parameter is not set, the default name will be used.
OIDC provider URL — URL of the OIDC provider. GitLab uses this address to automatically get the provider configuration, including the authorization and token endpoint addresses.
Client authentication method — The method GitLab uses to authenticate with the OIDC provider. If you select
basic, credentials are passed in the header; if you selectquery, they are passed in the request parameters.UID field name — Name of the field from the
user_info.raw_attributesresponse whose value will be used as the unique user identifier (UID) in GitLab. Thesub(Subject) field is used by default.Send scope to token endpoint — Specifies whether GitLab should include the
scopeparameter in the request to the token endpoint.Enable PKCE — Specifies whether to enable PKCE (Proof Key for Code Exchange) support. This mechanism significantly increases the security of the authorization process by preventing authorization code interception.
Client ID — The unique client identifier assigned to the GitLab application when it was registered in the OIDC provider control panel.
Client secret — The client secret key used to authenticate GitLab with the OIDC provider.
When enabling LDAP, specify:
LDAP settings
Login button name — Text to be displayed on the login button in the GitLab interface.
LDAP server host — IP address or domain name of the LDAP server.
UID attribute — The LDAP attribute that corresponds to the user name used to log in to GitLab (for example,
sAMAccountNamefor Active Directory oruidfor OpenLDAP).Search base — The base path from which the user search in the directory starts, for example:
ou=people,dc=gitlab,dc=exampleorDC=mydomain,DC=com.Encryption method — The method used to encrypt the connection to the LDAP server:
plain— unencrypted connection;simple_tls— implicit encryption (Implicit TLS): the connection is encrypted right from the moment it is established.start_tls— explicit encryption (Explicit TLS): an unencrypted connection is established first and then upgraded to encryption using the STARTTLS mechanism.
Bind account — The full path (Distinguished Name) of the user on whose behalf GitLab connects to the LDAP server to search for users, for example:
CN=Gitlab,OU=Users,DC=domain,DC=com.Bind password — The user password for GitLab authorization in the directory service.
CA certificate content — The CA certificate file content is used if the
simple_tlsorstart_tlsencryption method is selected and certificate verification is enabled.SSL version — The SSL/TLS version that OpenSSL should use if the default system settings are not suitable.
SSL ciphers — Specific SSL ciphers to be used when communicating with the LDAP server (for example, to disable outdated and insecure protocols).
Client certificate content — The client certificate content must be provided when the LDAP server requires mutual authentication (mTLS) and verifies the client certificate.
Client certificate key content — The private key of the client certificate.
Verify SSL certificates — Specifies whether GitLab should verify the validity of the server SSL certificate when using the
simple_tlsorstart_tlsencryption methods.Active Directory server — Specifies whether GitLab should use queries specific to Microsoft Active Directory. For all other types of LDAP servers (for example, OpenLDAP), this option must be disabled.
Allow login by name or email — If this option is selected, both the email address and the user name (the part of the address before @) can be used to log in to GitLab.
User filter — A filter to restrict the list of users with access to GitLab, in RFC 4515 format. For example, it allows you to permit login only to members of a specific group: (
memberOf=CN=GitLab_Users,CN=Groups,DC=example,DC=com).Convert to lowercase — If the option is enabled, GitLab automatically converts all user names to lowercase.
Retry response codes — The list of LDAP response codes for which GitLab will retry the operation if the result or the request content is empty.
To save new settings, click Modify.
Service start and stop#
You can stop the development service, if you don’t need it, and start it when necessary, thus saving money on computing resources, because only attached volumes. are billed when the service is stopped.
You can also restart the service in case of an error, and synchronize the service status with those of the instances where it is installed.
Stop service#
The service can be stopped when it is in the Running or Error state.
Go to PaaS Running services and open the Development tab.
In the resource table, find the service you want to stop and click the shutdown icon in the Actions field. Alternatively, click the service ID to go to its page and then click Stop in the Information tab.
In the dialog window, confirm the action.
Restart the service#
The service can be restarted when it is in the Running or Error state.
Go to PaaS Running services and open the Development tab.
In the resource table, find the service you want to restart and click the restart icon in the Actions field. Alternatively, click the service ID to go to its page and then click Restart in the Information tab.
In the dialog window, confirm the action.
Synchronize the service with instances#
Synchronization allows you to match the states of the service and the instances on which it is installed, when instances were manually started after the service was stopped. It can also be used to match the states if an error occurred when stopping, starting, or restarting the service and instances had to be manually stopped/started.
Attention
Synchronization is not possible if the error cannot be eliminated (the error status can be viewed, for example, using the DescribeService method).
Go to PaaS Running services and open the Development tab.
In the resource table, find the service you want to synchronize and click the synchronization icon in the Actions field. Alternatively, click the service ID to go to its page and then click Synchronize with confirmation in the Information tab.
In the dialog window, confirm the action.
Start the service#
You can only start the service, when it is in the Stopped state.
Go to PaaS Running services and open the Development tab.
In the resource table, find the service you want to start and click the start icon in the Actions field. Alternatively, click the service ID to go to its page and then click Start in the Information tab.
In the dialog window, confirm the action.
Configuring the maintenance window#
During scheduled maintenance, critical security patches and other important updates are installed.
Attention
During maintenance, operations with the service, including its deletion, are not available, but the service itself will continue to operate. In some cases, it may be necessary to stop and restart the cluster nodes.
Maintenance is carried out strictly during a preset time period (if a maintenance window is specified). All actions of K2 Cloud specialists during maintenance are logged.
Note
You can modify the maintenance window settings when the service is in the Running state only.
To modify the maintenance window settings:
Go to PaaS Running services and open the Development tab.
Find the desired service in the table and click the service ID to go to its page.
In the Maintenance tab, click Set up.
In the window that opens, specify the maintenance interval that is convenient for you. To do so, select the following parameters:
the
Scheduledvalue for the Maintenance window option;a day of the week for the maintenance to take place;
hour interval for the maintenance window.
Or select the
Customvalue for the Maintenance window option, if maintenance can be performed at any time.Click Save to modify the maintenance window.
Viewing metrics#
The following metrics are available for the GitLab service:
Metrics |
Description |
|---|---|
GitLab Sidekiq queue size |
Number of jobs in Sidekiq queues |
GitLab Sidekiq queue latency |
Maximum job wait time in Sidekiq queues |
GitLab Sidekiq dead jobs |
Number of Sidekiq jobs that exhausted the retry limit |
GitLab Sidekiq processed jobs |
Number of Sidekiq jobs processed per second |
GitLab Sidekiq failed jobs ratio |
Share of failed Sidekiq jobs |
GitLab Sidekiq retry jobs |
Number of Sidekiq jobs awaiting a retry after an error |
GitLab Sidekiq busy workers |
Number of Sidekiq threads executing jobs |
Redis availability |
Redis service availability |
GitLab Redis memory used |
Memory used by Redis |
Redis OPS |
Number of commands processed per second |
PostgreSQL availability |
PostgreSQL service availability |
PostgreSQL connections usage |
Share of the connection limit used |
PostgreSQL max transaction duration |
Duration of the longest transaction |
PostgreSQL database size |
Database size |
Volume utilization |
Share of disk space used on |
CPU utilization |
Processor load |
Memory utilization |
Share of memory used |
OOM kill count |
Number of processes terminated due to insufficient memory |
To view the metrics of a specific service:
Go to PaaS Running services and open the Development tab.
Find the desired service in the table and click the service ID to go to its page.
Open the Monitoring tab and select:
metrics,
instance to collect metric from.
Note
Instances available for a particular metric depend on their role. For certain metrics, there can be additional selectors apart from instance choice.
Go to Display parameters to set the period the metric graph covers, statistics, and metric calculation interval. To automatically refresh the graph, enable Auto-refresh; to refresh it manually, click Refresh.
Deleting the GitLab service#
Deleting the GitLab service consists in deleting the instance and volumes created together with it.
To delete the service:
Go to the section PaaS Running services.
Open the Development tab and click in the resource table. Alternatively, you can go to the service page and click Delete.
If you want to use the network interfaces in the future, for example, to recreate the service with the same network parameters, disable the Delete attached network interfaces option in the window that opens.
To confirm the deletion, click Delete.