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