Commit ddf81928 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'use-helm-to-install-gitlab-agent' into 'master'

Recommend Helm for installing the GitLab agent

See merge request gitlab-org/gitlab!84219
parents 2ef4cf29 0ecc5a4f
export function generateAgentRegistrationCommand(agentToken, kasAddress) {
return `docker run --pull=always --rm \\
registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/cli:stable generate \\
--agent-token=${agentToken} \\
--kas-address=${kasAddress} \\
--agent-version stable \\
--namespace gitlab-kubernetes-agent | kubectl apply -f -`;
return `helm repo add gitlab https://charts.gitlab.io
helm repo update
helm upgrade --install gitlab-agent gitlab/gitlab-agent \\
--namespace gitlab-agent \\
--create-namespace \\
--set config.token=${agentToken} \\
--set config.kasAddress=${kasAddress}`;
}
export function getAgentConfigPath(clusterAgentName) {
......
......@@ -9,7 +9,7 @@ import { I18N_AGENT_TOKEN } from '../constants';
export default {
i18n: I18N_AGENT_TOKEN,
advancedInstallPath: helpPagePath('user/clusters/agent/install/index', {
anchor: 'advanced-installation',
anchor: 'advanced-installation-method',
}),
components: {
GlAlert,
......
......@@ -96,9 +96,9 @@ export const I18N_AGENT_TOKEN = {
),
tokenSubtitle: s__('ClusterAgents|The agent uses the token to connect with GitLab.'),
basicInstallTitle: s__('ClusterAgents|Recommended installation method'),
basicInstallTitle: s__('ClusterAgents|Install using Helm (recommended)'),
basicInstallBody: s__(
'ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included.',
'ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included in the command.',
),
advancedInstallTitle: s__('ClusterAgents|Advanced installation methods'),
......
This diff is collapsed.
......@@ -8004,7 +8004,7 @@ msgstr ""
msgid "ClusterAgents|Failed to register an agent"
msgstr ""
msgid "ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included."
msgid "ClusterAgents|From a terminal, connect to your cluster and run this command. The token is included in the command."
msgstr ""
msgid "ClusterAgents|GitLab agent"
......@@ -8022,6 +8022,9 @@ msgstr ""
msgid "ClusterAgents|How to update an agent?"
msgstr ""
msgid "ClusterAgents|Install using Helm (recommended)"
msgstr ""
msgid "ClusterAgents|Last connected %{timeAgo}."
msgstr ""
......@@ -8055,9 +8058,6 @@ msgstr ""
msgid "ClusterAgents|Recommended"
msgstr ""
msgid "ClusterAgents|Recommended installation method"
msgstr ""
msgid "ClusterAgents|Register"
msgstr ""
......
......@@ -34,7 +34,7 @@ RSpec.describe 'Cluster agent registration', :js do
expect(page).to have_content('You cannot see this token again after you close this window.')
expect(page).to have_content('example-agent-token')
expect(page).to have_content('docker run --pull=always --rm')
expect(page).to have_content('helm upgrade --install')
within find('.modal-footer') do
click_button('Close')
......
......@@ -69,8 +69,8 @@ describe('InstallAgentModal', () => {
});
it('shows code block with agent installation command', () => {
expect(findCodeBlock().props('code')).toContain(`--agent-token=${agentToken}`);
expect(findCodeBlock().props('code')).toContain(`--kas-address=${kasAddress}`);
expect(findCodeBlock().props('code')).toContain(`--set config.token=${agentToken}`);
expect(findCodeBlock().props('code')).toContain(`--set config.kasAddress=${kasAddress}`);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment