<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flux – Flux bootstrap</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/</link><description>Recent content in Flux bootstrap on Flux</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/index.xml" rel="self" type="application/rss+xml"/><item><title>Flux: Flux bootstrap for Git servers</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/</guid><description>
&lt;p>The
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/cmd/flux_bootstrap_git/">flux bootstrap git&lt;/a> command deploys the Flux controllers
on a Kubernetes cluster and configures the controllers to sync the cluster state from a Git repository.
Besides installing the controllers, the bootstrap command pushes the Flux manifests to the Git repository
and configures Flux to update itself from Git.&lt;/p>
&lt;p>After running the bootstrap command, any operation on the cluster (including Flux upgrades)
can be done via Git push, without the need to connect to the Kubernetes cluster.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command has &lt;strong>push rights&lt;/strong> to the Git repository.
&lt;/div>
&lt;h2 id="ssh-private-key">SSH Private Key&lt;/h2>
&lt;p>Run bootstrap for an existing Git repository and authenticate with a SSH key which has pull and push access:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The private key is stored in the cluster as a Kubernetes secret named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">SSH Key rotation&lt;/h4>
&lt;p>To regenerate the SSH private key and known hosts keys,
delete the &lt;code>flux-system&lt;/code> secret from the cluster and run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux create secret git flux-system &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/div>
&lt;h2 id="ssh-agent">SSH Agent&lt;/h2>
&lt;p>Run bootstrap for an existing Git repository and authenticate with your SSH agent:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">SSH hostname&lt;/h4>
If the Flux controllers must connect to a different SSH endpoint
than the CLI, you can set the SSH hostname and port for the cluster
with &lt;code>--ssh-hostname=&amp;lt;host:port&amp;gt;&lt;/code>.
Note that if set, your SSH hostname and port could be overwritten by
your
&lt;a href="https://linux.die.net/man/5/ssh_config" target="_blank">ssh_config&lt;/a>.
&lt;/div>
&lt;p>When using the SSH Agent, the bootstrap command will generate a new SSH private key for the cluster,
and it will prompt you to add the SSH public key as a deploy key to your repository.&lt;/p>
&lt;p>The generated SSH key defaults to &lt;code>ECDSA P-384&lt;/code>, to change the format use &lt;code>--ssh-key-algorithm&lt;/code> and &lt;code>--ssh-ecdsa-curve&lt;/code>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">SSH Key rotation&lt;/h4>
&lt;p>To regenerate the SSH private key and known hosts keys,
delete the &lt;code>flux-system&lt;/code> secret from the cluster and run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux create secret git flux-system &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --ssh-key-algorithm&lt;span style="color:#666">=&lt;/span>ecdsa &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --ssh-ecdsa-curve&lt;span style="color:#666">=&lt;/span>p384
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The CLI will prompt you to add the SSH public key as a deploy key to your repository.&lt;/p>
&lt;/div>
&lt;h2 id="https-basic-auth">HTTPS basic auth&lt;/h2>
&lt;p>If your Git server has basic auth enabled, you can bootstrap Flux over HTTPS with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --username&lt;span style="color:#666">=&lt;/span>&amp;lt;my-username&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;my-password&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#007020">true&lt;/span> &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can also supply the password or Git token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;my-pass&amp;gt;&amp;quot; | flux bootstrap git&lt;/code>.&lt;/p>
&lt;p>If your Git server uses a self-signed TLS certificate, you can specify the CA file with
&lt;code>--ca-file=&amp;lt;path/to/ca.crt&amp;gt;&lt;/code>.&lt;/p>
&lt;h2 id="https-authorization-header">HTTPS authorization header&lt;/h2>
&lt;p>To access Git repositories that require a bearer token in the HTTP headers
as an Authorization header such as
&lt;a href="https://docs.oracle.com/en/cloud/paas/visual-builder/visualbuilder-manage-development-process/access-git-repository-using-token-based-authentication.html" target="_blank">Oracle VBS Git Repositories&lt;/a>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;Access Token&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --with-bearer-token &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If your Git server uses a self-signed TLS certificate, you can specify the CA file with
&lt;code>--ca-file=&amp;lt;path/to/ca.crt&amp;gt;&lt;/code>.&lt;/p>
&lt;h2 id="bootstrap-multiple-clusters">Bootstrap multiple clusters&lt;/h2>
&lt;p>With &lt;code>--path&lt;/code> you can configure the directory which will be used to reconcile the target cluster.
To control multiple clusters from the same Git repository, you have to set a unique path per
cluster e.g. &lt;code>clusters/staging&lt;/code> and &lt;code>clusters/production&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>./clusters/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── staging &lt;span style="color:#60a0b0;font-style:italic"># &amp;lt;- path=clusters/staging&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   └── flux-system &lt;span style="color:#60a0b0;font-style:italic"># &amp;lt;- namespace dir generated by bootstrap&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── gotk-components.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── gotk-sync.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   └── kustomization.yaml
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>└── production &lt;span style="color:#60a0b0;font-style:italic"># &amp;lt;- path=clusters/production&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> └── flux-system
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Bootstrap options&lt;/h4>
There are many options available when bootstrapping Flux, such as installing a subset of Flux components,
setting the Kubernetes context, changing the Git author name and email, enabling Git submodules, and more.
To list all the available options run &lt;code>flux bootstrap git --help&lt;/code>.
&lt;/div></description></item><item><title>Flux: Flux bootstrap for Gitea</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/gitea/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/gitea/</guid><description>
&lt;p>The
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/cmd/flux_bootstrap_gitea/">flux bootstrap gitea&lt;/a> command deploys the Flux controllers
on a Kubernetes cluster and configures the controllers to sync the cluster state from a Gitea repository.
Besides installing the controllers, the bootstrap command pushes the Flux manifests to the Gitea repository
and configures Flux to update itself from Gitea.&lt;/p>
&lt;p>After running the bootstrap command, any operation on the cluster (including Flux upgrades)
can be done via Git push, without the need to connect to the Kubernetes cluster.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to be the &lt;strong>owner&lt;/strong> of the Gitea repository,
or to have admin rights of a Gitea organization.
&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Forgejo support&lt;/h4>
Forgejo is a fork of Gitea (see their
&lt;a href="https://forgejo.org/compare-to-gitea/" target="_blank">Comparison with Gitea&lt;/a>).
Given that Forgejo is mainly backward compatible with Gitea, you can use the same commands that you use for Gitea and it will work.
&lt;/div>
&lt;h2 id="gitea-pat">Gitea PAT&lt;/h2>
&lt;p>For accessing the Gitea API, the bootstrap command requires a Gitea personal access token (PAT)
with the following permissions:&lt;/p>
&lt;ul>
&lt;li>read:misc&lt;/li>
&lt;li>write:repository&lt;/li>
&lt;/ul>
&lt;p>If you want Flux to to create a new personal repository with Flux the following permissions are necessary:&lt;/p>
&lt;ul>
&lt;li>read:misc&lt;/li>
&lt;li>write:repository&lt;/li>
&lt;li>write:user&lt;/li>
&lt;/ul>
&lt;p>If you want Flux to to create a new organization repository with Flux the following permissions are necessary:&lt;/p>
&lt;ul>
&lt;li>read:misc&lt;/li>
&lt;li>write:organization&lt;/li>
&lt;li>write:repository&lt;/li>
&lt;/ul>
&lt;p>The Gitea PAT can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">GITEA_TOKEN&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;gt-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>GITEA_TOKEN&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.&lt;/p>
&lt;p>You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;gt-token&amp;gt;&amp;quot; | flux bootstrap gitea&lt;/code>.&lt;/p>
&lt;h2 id="gitea-personal-account">Gitea Personal Account&lt;/h2>
&lt;p>Run the bootstrap for a repository on your personal Gitea account:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap gitea &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-gitea-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository-name &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --personal
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the specified repository does not exist, Flux will create it for you as private. If you wish to create
a public repository, set &lt;code>--private=false&lt;/code>.&lt;/p>
&lt;p>When using &lt;code>--token-auth&lt;/code>, the CLI and the Flux controllers running on the cluster will use the Gitea PAT
to access the Git repository over HTTPS.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">PAT secret&lt;/h4>
Note that the Gitea PAT is stored in the cluster as a &lt;strong>Kubernetes Secret&lt;/strong> named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace. If you want to avoid storing your PAT in the cluster,
please see how to configure
&lt;a href="#gitea-deploy-keys">Gitea Deploy Keys&lt;/a>.
&lt;/div>
&lt;h2 id="gitea-organization">Gitea Organization&lt;/h2>
&lt;p>If you want to bootstrap Flux for a repository owned by a Gitea organization,
it is recommended to create a dedicated user for Flux under your organization.&lt;/p>
&lt;p>Run the bootstrap for a repository owned by a Gitea organization:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap gitea &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> &lt;span style="color:#4070a0">`&lt;/span>--token-auth&lt;span style="color:#4070a0">`&lt;/span> &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-gitea-organization &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="gitea-deploy-keys">Gitea Deploy Keys&lt;/h2>
&lt;p>If you want to bootstrap Flux using SSH instead of HTTP/S, you can set &lt;code>--token-auth=false&lt;/code> and the Flux CLI
will use the Gitea PAT to set a deploy key for your repository.&lt;/p>
&lt;p>When using SSH, the bootstrap command will generate a SSH private key. The private key is stored
in the cluster as a Kubernetes secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;p>The generated SSH key defaults to &lt;code>ECDSA P-384&lt;/code>, to change the format use &lt;code>--ssh-key-algorithm&lt;/code> and &lt;code>--ssh-ecdsa-curve&lt;/code>.&lt;/p>
&lt;p>The SSH public key, is used to create a Gitea deploy key.
The deploy key is linked to the personal access token used to authenticate.&lt;/p>
&lt;p>By default, the Gitea deploy key is set to read-only access.
If you&amp;rsquo;re using Flux image automation, you must give it write access with &lt;code>--read-write-key=true&lt;/code>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Deploy Key rotation&lt;/h4>
Note that when the PAT is removed or when it expires, the Gitea deploy key will stop working.
To regenerate the deploy key, delete the &lt;code>flux-system&lt;/code> secret from the cluster and re-run
the bootstrap command using a valid Gitea PAT.
&lt;/div>
&lt;h2 id="bootstrap-without-a-gitea-pat">Bootstrap without a Gitea PAT&lt;/h2>
&lt;p>For existing Gitea repositories, you can bootstrap Flux over SSH without using a Gitea PAT.&lt;/p>
&lt;p>To use a SSH key instead of a Gitea PAT, the command changes to &lt;code>flux bootstrap git&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@gitea.com/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note&lt;/strong> that you must generate a SSH private key and set the public key as a deploy key on Gitea in advance.&lt;/p>
&lt;p>For more information on how to use the &lt;code>flux bootstrap git&lt;/code> command,
please see the generic Git server
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">documentation&lt;/a>.&lt;/p></description></item><item><title>Flux: Flux bootstrap for GitHub</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/github/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/github/</guid><description>
&lt;p>The
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/cmd/flux_bootstrap_github/">flux bootstrap github&lt;/a> command deploys the Flux controllers
on a Kubernetes cluster and configures the controllers to sync the cluster state from a GitHub repository.
Besides installing the controllers, the bootstrap command pushes the Flux manifests to the GitHub repository
and configures Flux to update itself from Git.&lt;/p>
&lt;p>After running the bootstrap command, any operation on the cluster (including Flux upgrades)
can be done via Git push, without the need to connect to the Kubernetes cluster.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to be the &lt;strong>owner&lt;/strong> of the GitHub repository,
or to have admin rights of a GitHub organization.
&lt;/div>
&lt;h2 id="github-pat">GitHub PAT&lt;/h2>
&lt;p>For accessing the GitHub API, the bootstrap command requires a GitHub personal access token (PAT)
with administration permissions.&lt;/p>
&lt;p>The GitHub PAT can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">GITHUB_TOKEN&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;gh-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>GITHUB_TOKEN&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.&lt;/p>
&lt;p>You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;gh-token&amp;gt;&amp;quot; | flux bootstrap github&lt;/code>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">GitHub fine-grained PAT&lt;/h4>
&lt;p>Bootstrap can be run with a GitHub
&lt;a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens" target="_blank">fine-grained personal access token&lt;/a>,
for repositories that are created ahead of time.&lt;/p>
&lt;p>The fine-grained PAT must be generated with the following permissions:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Administration&lt;/code> -&amp;gt; &lt;code>Access: Read-only&lt;/code>&lt;/li>
&lt;li>&lt;code>Contents&lt;/code> -&amp;gt; &lt;code>Access: Read and write&lt;/code>&lt;/li>
&lt;li>&lt;code>Metadata&lt;/code> -&amp;gt; &lt;code>Access: Read-only&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Note that &lt;code>Administration&lt;/code> should be set to &lt;code>Access: Read and write&lt;/code> when using &lt;code>bootstrap github --token-auth=false&lt;/code>.&lt;/p>
&lt;/div>
&lt;h2 id="github-personal-account">GitHub Personal Account&lt;/h2>
&lt;p>If you want to bootstrap Flux for a repository owned by a personal account, you can generate a
&lt;a href="https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line" target="_blank">GitHub PAT&lt;/a>
that can create repositories by checking all permissions under &lt;code>repo&lt;/code>.&lt;/p>
&lt;p>If you want to use an existing repository, the PAT&amp;rsquo;s user must have &lt;code>admin&lt;/code>
&lt;a href="https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role" target="_blank">permissions&lt;/a>.&lt;/p>
&lt;p>Run the bootstrap for a repository on your personal GitHub account:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap github &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-github-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository-name &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --personal
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the specified repository does not exist, Flux will create it for you as private. If you wish to create
a public repository, set &lt;code>--private=false&lt;/code>.&lt;/p>
&lt;p>When using &lt;code>--token-auth&lt;/code>, the CLI and the Flux controllers running on the cluster will use the GitHub PAT
to access the Git repository over HTTPS.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">PAT secret&lt;/h4>
Note that the GitHub PAT is stored in the cluster as a &lt;strong>Kubernetes Secret&lt;/strong> named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace. If you want to avoid storing your PAT in the cluster,
please see how to configure
&lt;a href="#github-deploy-keys">GitHub Deploy Keys&lt;/a>.
&lt;/div>
&lt;h2 id="github-organization">GitHub Organization&lt;/h2>
&lt;p>If you want to bootstrap Flux for a repository owned by an GitHub organization,
it is recommended to create a dedicated user for Flux under your organization.&lt;/p>
&lt;p>Generate a GitHub PAT for the Flux user that can create repositories by checking all permissions under &lt;code>repo&lt;/code>.&lt;/p>
&lt;p>If you want to use an existing repository, the Flux user must have &lt;code>admin&lt;/code> permissions for that repository.&lt;/p>
&lt;p>Run the bootstrap for a repository owned by a GitHub organization:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap github &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-github-organization &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When creating a new repository, you can specify a list of GitHub teams with &lt;code>--team=team1-slug,team2-slug&lt;/code>,
those teams will be granted maintainer access to the repository.&lt;/p>
&lt;h2 id="github-enterprise">GitHub Enterprise&lt;/h2>
&lt;p>To run the bootstrap for a repository hosted on GitHub Enterprise, you have to specify your GitHub hostname:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap github &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --hostname&lt;span style="color:#666">=&lt;/span>my-github-enterprise.com &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-github-organization &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you want use SSH and
&lt;a href="#github-deploy-keys">GitHub deploy keys&lt;/a>,
set &lt;code>--token-auth=false&lt;/code> and provide the SSH hostname with &lt;code>--ssh-hostname=my-github-enterprise.com&lt;/code>.&lt;/p>
&lt;h2 id="github-deploy-keys">GitHub Deploy Keys&lt;/h2>
&lt;p>If you want to bootstrap Flux using SSH instead of HTTP/S, you can set &lt;code>--token-auth=false&lt;/code> and the Flux CLI
will use the GitHub PAT to set a deploy key for your repository.&lt;/p>
&lt;p>When using SSH, the bootstrap command will generate a SSH private key. The private key is stored
in the cluster as a Kubernetes secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;p>The generated SSH key defaults to &lt;code>ECDSA P-384&lt;/code>, to change the format use &lt;code>--ssh-key-algorithm&lt;/code> and &lt;code>--ssh-ecdsa-curve&lt;/code>.&lt;/p>
&lt;p>The SSH public key, is used to create a GitHub deploy key.
The deploy key is linked to the personal access token used to authenticate.&lt;/p>
&lt;p>By default, the GitHub deploy key is set to read-only access.
If you&amp;rsquo;re using Flux image automation, you must give it write access with &lt;code>--read-write-key=true&lt;/code>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Deploy Key rotation&lt;/h4>
Note that when the PAT is removed or when it expires, the GitHub deploy key will stop working.
To regenerate the deploy key, delete the &lt;code>flux-system&lt;/code> secret from the cluster and re-run
the bootstrap command using a valid GitHub PAT.
&lt;/div>
&lt;h2 id="bootstrap-without-a-github-pat">Bootstrap without a GitHub PAT&lt;/h2>
&lt;p>For existing GitHub repositories, you can bootstrap Flux over SSH without using a GitHub PAT.&lt;/p>
&lt;p>To use a SSH key instead of a GitHub PAT, the command changes to &lt;code>flux bootstrap git&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@github.com/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note&lt;/strong> that you must generate a SSH private key and set the public key as a deploy key on GitHub in advance.&lt;/p>
&lt;p>For more information on how to use the &lt;code>flux bootstrap git&lt;/code> command,
please see the generic Git server
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">documentation&lt;/a>.&lt;/p></description></item><item><title>Flux: Flux bootstrap for GitLab</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/gitlab/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/gitlab/</guid><description>
&lt;p>The
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/cmd/flux_bootstrap_gitlab/">flux bootstrap gitlab&lt;/a> command deploys the Flux controllers
on a Kubernetes cluster and configures the controllers to sync the cluster state from a GitLab project.
Besides installing the controllers, the bootstrap command pushes the Flux manifests to the GitLab project
and configures Flux to update itself from Git.&lt;/p>
&lt;p>After running the bootstrap command, any operation on the cluster (including Flux upgrades)
can be done via Git push, without the need to connect to the Kubernetes cluster.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to be the &lt;strong>owner&lt;/strong> of the GitLab project,
or to have admin rights of a GitLab group.
&lt;/div>
&lt;h2 id="gitlab-pat">GitLab PAT&lt;/h2>
&lt;p>For accessing the GitLab API, the bootstrap command requires a GitLab personal access token (PAT)
with complete read/write access to the GitLab API.&lt;/p>
&lt;p>The GitLab PAT can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">GITLAB_TOKEN&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;gl-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>GITLAB_TOKEN&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.&lt;/p>
&lt;p>You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;gl-token&amp;gt;&amp;quot; | flux bootstrap gitlab&lt;/code>.&lt;/p>
&lt;h2 id="gitlab-personal-account">GitLab Personal Account&lt;/h2>
&lt;p>Run the bootstrap for a project on your personal GitLab account:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap gitlab &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --deploy-token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-gitlab-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-project &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>master &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --personal
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the specified project does not exist, Flux will create it for you as private. If you wish to create
a public project, set &lt;code>--private=false&lt;/code>.&lt;/p>
&lt;p>When using &lt;code>--deploy-token-auth&lt;/code>, the CLI generates a
&lt;a href="https://docs.gitlab.com/ee/user/project/deploy_tokens/" target="_blank">GitLab project deploy token&lt;/a>
and stores it in the cluster as a Kubernetes Secret named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Deploy token read-only&lt;/h4>
Note that project deploy tokens grant read-only access to Git.
If you want to use Flux image automation, please see how to configure
&lt;a href="#gitlab-deploy-keys">GitLab Deploy Keys&lt;/a> with
read-write Git accesses.
&lt;/div>
&lt;h2 id="gitlab-groups">GitLab Groups&lt;/h2>
&lt;p>Run the bootstrap for a project owned by a GitLab (sub)group:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap gitlab &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --deploy-token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-gitlab-group/my-gitlab-subgroup &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-project &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>master &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="gitlab-enterprise">GitLab Enterprise&lt;/h2>
&lt;p>To run the bootstrap for a project hosted on GitLab on-prem or enterprise, you have to specify your GitLab hostname:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap gitlab &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --hostname&lt;span style="color:#666">=&lt;/span>my-gitlab-enterprise.com &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-gitlab-group &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-project &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>master &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you want to use SSH and
&lt;a href="#gitlab-deploy-keys">GitLab deploy keys&lt;/a>,
set &lt;code>--token-auth=false&lt;/code> and provide the SSH hostname with &lt;code>--ssh-hostname=my-gitlab-enterprise.com&lt;/code>.&lt;/p>
&lt;h2 id="gitlab-deploy-keys">GitLab Deploy Keys&lt;/h2>
&lt;p>If you want to bootstrap Flux using SSH instead of HTTP/S, you can set &lt;code>--token-auth=false&lt;/code>
and the Flux CLI will use the GitLab PAT to set a deploy key for your project.&lt;/p>
&lt;p>When using SSH, the bootstrap command will generate a SSH private key. The private key is stored
in the cluster as a Kubernetes secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;p>The generated SSH key defaults to &lt;code>ECDSA P-384&lt;/code>, to change the format use &lt;code>--ssh-key-algorithm&lt;/code> and &lt;code>--ssh-ecdsa-curve&lt;/code>.&lt;/p>
&lt;p>The SSH public key, is used to create a GitLab deploy key.
By default, the GitLab deploy key is set to read-only access.
If you&amp;rsquo;re using Flux image automation, you must give it write access with &lt;code>--read-write-key=true&lt;/code>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Deploy Key rotation&lt;/h4>
To regenerate the deploy key, delete the &lt;code>flux-system&lt;/code> secret from the cluster and re-run
the bootstrap command using a valid GitLab PAT.
&lt;/div>
&lt;h2 id="bootstrap-without-a-gitlab-pat">Bootstrap without a GitLab PAT&lt;/h2>
&lt;p>For existing GitLab repositories, you can bootstrap Flux over SSH without using a GitLab PAT.&lt;/p>
&lt;p>To use an SSH key instead of a GitLab PAT, the command changes to &lt;code>flux bootstrap git&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@gitlab.com/&amp;lt;group&amp;gt;/&amp;lt;project&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note&lt;/strong> that you must generate an SSH private key and set the public key as a deploy key on GitLab in advance.&lt;/p>
&lt;p>For more information on how to use the &lt;code>flux bootstrap git&lt;/code> command,
please see the generic Git server
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">documentation&lt;/a>.&lt;/p></description></item><item><title>Flux: Flux bootstrap for Bitbucket</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/bitbucket/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/bitbucket/</guid><description>
&lt;p>The
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/cmd/flux_bootstrap_bitbucket-server/">flux bootstrap bitbucket-server&lt;/a> command deploys the Flux controllers
on a Kubernetes cluster and configures the controllers to sync the cluster state from a Bitbucket project.
Besides installing the controllers, the bootstrap command pushes the Flux manifests to the Bitbucket project
and configures Flux to update itself from Git.&lt;/p>
&lt;p>After running the bootstrap command, any operation on the cluster (including Flux upgrades)
can be done via Git push, without the need to connect to the Kubernetes cluster.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to be the &lt;strong>owner&lt;/strong> of the Bitbucket project,
or to have admin rights of a Bitbucket group.
&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Bitbucket versions&lt;/h4>
This bootstrap command works only with Bitbucket Server and Data Center.
For Bitbucket Cloud, please use the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">generic bootstrap&lt;/a> procedure.
&lt;/div>
&lt;h2 id="bitbucket-http-access-token">Bitbucket HTTP Access Token&lt;/h2>
&lt;p>For accessing the Bitbucket API, the bootstrap command requires a
&lt;a href="https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html" target="_blank">Bitbucket HTTP Access Token&lt;/a>
with administration permissions.&lt;/p>
&lt;p>The Bitbucket HTTP access token can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">BITBUCKET_TOKEN&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;bb-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>BITBUCKET_TOKEN&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.
You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;bb-token&amp;gt;&amp;quot; | flux bootstrap bitbucket-server&lt;/code>.&lt;/p>
&lt;h2 id="bitbucket-personal-account">Bitbucket Personal Account&lt;/h2>
&lt;p>Run the bootstrap for a repository on your personal Bitbucket Server account:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap bitbucket-server &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --hostname&lt;span style="color:#666">=&lt;/span>my-bitbucket-server.com &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-bitbucket-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --personal
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the specified repository does not exist, Flux will create it for you as private. If you wish to create
a public repository, set &lt;code>--private=false&lt;/code>.&lt;/p>
&lt;p>When using &lt;code>--token-auth&lt;/code>, the CLI and the Flux controllers running on the cluster will use the Bitbucket
token to access the Git repository over HTTPS.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">PAT secret&lt;/h4>
Note that the Bitbucket token is stored in the cluster as a &lt;strong>Kubernetes Secret&lt;/strong> named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace. If you want to avoid storing your token in the cluster,
please see how to configure
&lt;a href="#bitbucket-ssh-access-keys">Bitbucket SSH access keys&lt;/a>.
&lt;/div>
&lt;h2 id="bitbucket-personal-project">Bitbucket Personal Project&lt;/h2>
&lt;p>Run the bootstrap for a repository owned by a Bitbucket Server project:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap bitbucket-server &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --hostname&lt;span style="color:#666">=&lt;/span>my-bitbucket-server.com &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-bitbucket-project &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --username&lt;span style="color:#666">=&lt;/span>my-bitbucket-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --group&lt;span style="color:#666">=&lt;/span>group-name
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When you specify a list of groups, those teams will be granted write access to the repository.&lt;/p>
&lt;p>&lt;strong>Note:&lt;/strong> The &lt;code>username&lt;/code> is mandatory for &lt;code>project&lt;/code> owned repositories.
The specified user must own the &lt;code>BITBUCKET_TOKEN&lt;/code> and have sufficient rights
on the target &lt;code>project&lt;/code> to create repositories.&lt;/p>
&lt;h2 id="bitbucket-ssh-access-keys">Bitbucket SSH Access Keys&lt;/h2>
&lt;p>If you want to bootstrap Flux using SSH instead of HTTP/S, you can set &lt;code>--token-auth=false&lt;/code> and the Flux CLI
will use the Bitbucket token to set a SSH access key for your repository.&lt;/p>
&lt;p>When using SSH, the bootstrap command will generate a SSH private key. The private key is stored
in the cluster as a Kubernetes secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;p>The generated SSH key defaults to &lt;code>ECDSA P-384&lt;/code>, to change the format use &lt;code>--ssh-key-algorithm&lt;/code> and &lt;code>--ssh-ecdsa-curve&lt;/code>.&lt;/p>
&lt;p>By default, the SSH key is set to read-only access.
If you&amp;rsquo;re using Flux image automation, you must give it write access with &lt;code>--read-write-key=true&lt;/code>.&lt;/p>
&lt;p>To run the bootstrap for Bitbucket server with a custom SSH hostname and port:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap bitbucket-server &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --hostname&lt;span style="color:#666">=&lt;/span>my-bitbucket-server.com &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --ssh-hostname&lt;span style="color:#666">=&lt;/span>my-bitbucket-server.com:7999 &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --owner&lt;span style="color:#666">=&lt;/span>my-bitbucket-project &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --username&lt;span style="color:#666">=&lt;/span>my-bitbucket-username &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --repository&lt;span style="color:#666">=&lt;/span>my-repository &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="bootstrap-without-a-bitbucket-token">Bootstrap without a Bitbucket token&lt;/h2>
&lt;p>For existing Bitbucket repositories, you can bootstrap Flux over SSH without using a Bitbucket token.&lt;/p>
&lt;p>To use a SSH key instead of a Bitbucket token, the command changes to &lt;code>flux bootstrap git&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@&amp;lt;host&amp;gt;/&amp;lt;org&amp;gt;/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note&lt;/strong> that you must generate a SSH private key and set the public key as the access key on Bitbucket in advance.&lt;/p>
&lt;p>For more information on how to use the &lt;code>flux bootstrap git&lt;/code> command,
please see the generic Git server
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">documentation&lt;/a>.&lt;/p></description></item><item><title>Flux: Flux bootstrap for AWS CodeCommit</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/aws-codecommit/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/aws-codecommit/</guid><description>
&lt;p>To install Flux on an EKS cluster using a CodeCommit repository as the source of truth,
you can use the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">&lt;code>flux bootstrap git&lt;/code>&lt;/a> command.
Flux can authenticate to CodeCommit over HTTPS with AWS IAM credentials, or over
SSH with an SSH key attached to an IAM user.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the AWS identity used by the Flux CLI has
&lt;strong>pull and push rights&lt;/strong> for the CodeCommit repository.
The AWS identity used by &lt;code>source-controller&lt;/code> in the cluster must have
&lt;strong>pull rights&lt;/strong> for the CodeCommit repository.
&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Private VPC&lt;/h4>
If your VPC is configured without internet access, or if you prefer that the access is over a private connection,
you need to set up a VPC endpoint to access CodeCommit by following the
guide
&lt;a href="https://docs.aws.amazon.com/codecommit/latest/userguide/codecommit-and-interface-VPC.html" target="_blank">Using AWS CodeCommit with interface VPC endpoints&lt;/a>.
&lt;/div>
&lt;h2 id="bootstrap-over-https-with-iam-role">Bootstrap over HTTPS with IAM role&lt;/h2>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Flux version&lt;/h4>
AWS CodeCommit over HTTPS with IAM credentials is supported
starting with Flux 2.9.x.
&lt;/div>
&lt;p>To bootstrap over HTTPS with an IAM role, make sure the Flux CLI can discover
AWS credentials from the environment, such as an assumed role, AWS SSO session,
instance profile, or other credentials supported by the AWS SDK.
For more details on IAM roles and AWS authentication methods in Flux, see the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/integrations/aws/">AWS authentication documentation&lt;/a>.&lt;/p>
&lt;p>You can verify the identity used by the Flux CLI with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>aws sts get-caller-identity
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>The IAM role used by the CLI must be allowed to &lt;code>codecommit:GitPull&lt;/code> and &lt;code>codecommit:GitPush&lt;/code>
permissions for the CodeCommit repository.&lt;/li>
&lt;li>The &lt;code>source-controller&lt;/code> running in the cluster also needs an IAM role with
&lt;code>codecommit:GitPull&lt;/code> for the same repository.&lt;/li>
&lt;/ul>
&lt;p>For additional details, see
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/integrations/aws/#for-amazon-codecommit">AWS CodeCommit Integration&lt;/a>.&lt;/p>
&lt;p>The bootstrap command configures the generated &lt;code>GitRepository&lt;/code> with
&lt;code>provider: aws&lt;/code> to use the controller-level AWS identity.&lt;/p>
&lt;p>Run bootstrap with the CodeCommit HTTPS URL:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://git-codecommit.&amp;lt;region&amp;gt;.amazonaws.com/v1/repos/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When using CodeCommit over HTTPS with IAM credentials, do not specify
&lt;code>--token-auth&lt;/code>, &lt;code>--username&lt;/code>, or &lt;code>--password&lt;/code>. The Flux CLI obtains temporary
Git credentials from AWS IAM for the bootstrap operation.&lt;/p>
&lt;h2 id="bootstrap-over-ssh">Bootstrap over SSH&lt;/h2>
&lt;p>Create a CodeCommit repository and generate a PEM-encoded RSA SSH private key
with a passphrase:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>ssh-keygen -t rsa -b &lt;span style="color:#40a070">4096&lt;/span> -m PEM -f ./codecommit_rsa
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Upload the SSH public key to the IAM user that Flux will use to access
CodeCommit:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>aws iam upload-ssh-public-key &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --user-name codecommit-user &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --ssh-public-key-body file://codecommit_rsa.pub
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The output will contain a field called &lt;code>SSHPublicKeyId&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;SSHPublicKey&amp;#34;&lt;/span>: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;SSHPublicKeyId&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;&amp;lt;SSH-Key-ID&amp;gt;&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;Fingerprint&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;&amp;lt;fingerprint&amp;gt;&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;SSHPublicKeyBody&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;&amp;lt;public-key&amp;gt;&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;Status&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;Active&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#062873;font-weight:bold">&amp;#34;UploadDate&amp;#34;&lt;/span>: &lt;span style="color:#4070a0">&amp;#34;&amp;lt;timestamp&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Run bootstrap using the &lt;code>SSHPublicKeyId&lt;/code> as the SSH username:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://&amp;lt;SSHPublicKeyId&amp;gt;@git-codecommit.&amp;lt;region&amp;gt;.amazonaws.com/v1/repos/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>./codecommit_rsa &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Do not use the IAM user name as the SSH username in the repository URL.
CodeCommit expects the SSH key ID assigned to the uploaded public key.&lt;/p>
&lt;p>You can also pipe the passphrase e.g. &lt;code>echo key-passphrase | flux bootstrap git&lt;/code>.&lt;/p>
&lt;p>The SSH private key and the known hosts keys are stored in the cluster as a Kubernetes
secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;p>For the full CodeCommit SSH setup, including where to find the SSH Key ID, see
the AWS CodeCommit SSH documentation for
&lt;a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html" target="_blank">Linux, macOS, or Unix&lt;/a>
and
&lt;a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-windows.html" target="_blank">Windows&lt;/a>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">SSH Key rotation&lt;/h4>
To rotate the SSH key, delete the &lt;code>flux-system&lt;/code> secret from the cluster and re-run
the bootstrap command using a new PEM-encoded RSA SSH private key.
&lt;/div></description></item><item><title>Flux: Flux bootstrap for Azure DevOps</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/azure-devops/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/azure-devops/</guid><description>
&lt;p>To install Flux on an AKS cluster using an Azure DevOps Git repository as the source of truth,
you can use the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">&lt;code>flux bootstrap git&lt;/code>&lt;/a> command.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to have &lt;strong>pull and push rights&lt;/strong> for the Azure DevOps Git repository.
&lt;/div>
&lt;h2 id="azure-devops-pat">Azure DevOps PAT&lt;/h2>
&lt;p>For accessing the Azure API, the bootstrap command requires an Azure DevOps personal access token (PAT)
with pull and push permissions for Git repositories.&lt;/p>
&lt;p>Generate an
&lt;a href="https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&amp;amp;tabs=preview-page" target="_blank">Azure DevOps PAT&lt;/a>
and create a new repository to hold your Flux install and other Kubernetes resources.&lt;/p>
&lt;p>The Azure DevOps PAT can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">GIT_PASSWORD&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;az-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>GIT_PASSWORD&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.&lt;/p>
&lt;p>You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;az-token&amp;gt;&amp;quot; | flux bootstrap git&lt;/code>.&lt;/p>
&lt;h2 id="bootstrap-using-a-devops-pat">Bootstrap using a DevOps PAT&lt;/h2>
&lt;p>Run the bootstrap for a repository using token-based authentication:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --token-auth&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#007020">true&lt;/span> &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://dev.azure.com/&amp;lt;org&amp;gt;/&amp;lt;project&amp;gt;/_git/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>main &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When using &lt;code>--token-auth&lt;/code>, the CLI and the Flux controllers running on the cluster will use the Azure DevOps PAT
to access the Git repository over HTTPS.&lt;/p>
&lt;p>Note that the Azure DevOps PAT is stored in the cluster as a &lt;strong>Kubernetes Secret&lt;/strong> named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Token rotation&lt;/h4>
&lt;p>Note that Azure DevOps PAT have an expiry date. To rotate the token before it expires,
delete the &lt;code>flux-system&lt;/code> secret from the cluster and create a new one with the new PAT:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux create secret git flux-system &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://dev.azure.com/&amp;lt;org&amp;gt;/&amp;lt;project&amp;gt;/_git/&amp;lt;repository&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --username&lt;span style="color:#666">=&lt;/span>git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;az-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/div>
&lt;h2 id="bootstrap-using-ssh-keys">Bootstrap using SSH keys&lt;/h2>
&lt;p>Azure DevOps SSH works only with RSA SHA-2 keys.&lt;/p>
&lt;p>To configure Flux with RSA SHA-2 keys, you need to clone the DevOps locally, then
create the file structure required by bootstrap with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>mkdir -p clusters/my-cluster/flux-system
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>touch clusters/my-cluster/flux-system/gotk-components.yaml &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> clusters/my-cluster/flux-system/gotk-sync.yaml &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> clusters/my-cluster/flux-system/kustomization.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Edit the &lt;code>kustomization.yaml&lt;/code> file to include the following patches:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kustomize.config.k8s.io/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Kustomization&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">resources&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-components.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-sync.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">patches&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - op: add
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> path: /spec/template/spec/containers/0/args/-
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> value: --ssh-hostkey-algos=rsa-sha2-512,rsa-sha2-256 &lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">target&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Deployment&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>(source-controller|image-automation-controller)&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Commit and push the changes to upstream with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>git add -A &lt;span style="color:#666">&amp;amp;&amp;amp;&lt;/span> git commit -m &lt;span style="color:#4070a0">&amp;#34;init flux&amp;#34;&lt;/span> &lt;span style="color:#666">&amp;amp;&amp;amp;&lt;/span> git push
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To generate an SSH key pair compatible with
Azure DevOps, you&amp;rsquo;ll need to use &lt;code>ssh-keygen&lt;/code> with the &lt;code>rsa-sha2-512&lt;/code> algorithm:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>ssh-keygen -t rsa-sha2-512
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Upload the SSH public key to Azure DevOps. For more information, see the
&lt;a href="https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops#step-2-add-the-public-key-to-azure-devops" target="_blank">Azure DevOps documentation&lt;/a>.&lt;/p>
&lt;p>Run bootstrap using the SSH URL of the Azure DevOps repository and the RSA SHA-2 private key:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://git@ssh.dev.azure.com/v3/&amp;lt;org&amp;gt;/&amp;lt;project&amp;gt;/&amp;lt;repository&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --ssh-hostkey-algos&lt;span style="color:#666">=&lt;/span>rsa-sha2-512,rsa-sha2-256 &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For more information on how to use the &lt;code>flux bootstrap git&lt;/code> command,
please see the generic Git server
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">documentation&lt;/a>.&lt;/p></description></item><item><title>Flux: Flux bootstrap for Google Cloud Source</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/google-cloud-source/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/google-cloud-source/</guid><description>
&lt;p>To install Flux on a GKE cluster using a Google Cloud Source repository as the source of truth,
you can use the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">&lt;code>flux bootstrap git&lt;/code>&lt;/a> command.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to have &lt;strong>pull and push rights&lt;/strong> for the Google Cloud Source repository.
&lt;/div>
&lt;h2 id="bootstrap-over-ssh">Bootstrap over SSH&lt;/h2>
&lt;p>First create a new repository to hold your Flux install and other Kubernetes resources.
Then generate a SSH key and add the SSH public key to your personal SSH keys on Google Cloud.&lt;/p>
&lt;p>Run bootstrap using the SSH private key and passphrase:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>ssh://&amp;lt;user&amp;gt;s@source.developers.google.com:2022/p/&amp;lt;project-name&amp;gt;/r/&amp;lt;repo-name&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>&amp;lt;my-branch&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --private-key-file&lt;span style="color:#666">=&lt;/span>&amp;lt;path/to/ssh/private.key&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --password&lt;span style="color:#666">=&lt;/span>&amp;lt;key-passphrase&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can also pipe the passphrase e.g. &lt;code>echo key-passphrase | flux bootstrap git&lt;/code>.&lt;/p>
&lt;p>The SSH private key and the known hosts keys are stored in the cluster as a Kubernetes
secret named &lt;code>flux-system&lt;/code> inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">SSH Key rotation&lt;/h4>
To rotate the SSH public key, delete the &lt;code>flux-system&lt;/code> secret from the cluster and re-run
the bootstrap command using a new SSH private key.
&lt;/div></description></item><item><title>Flux: Flux bootstrap for Oracle VBS Git Repositories</title><link>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/oracle-vbs-git-repositories/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/oracle-vbs-git-repositories/</guid><description>
&lt;p>To install Flux on an
&lt;a href="https://www.oracle.com/cloud/cloud-native/container-engine-kubernetes" target="_blank">OKE&lt;/a> cluster
using an Oracle VBS Git repository as the source of truth,
you can use the
&lt;a href="https://deploy-preview-2570--fluxcd.netlify.app/flux/installation/bootstrap/generic-git-server/">&lt;code>flux bootstrap git&lt;/code>&lt;/a> command.&lt;/p>
&lt;div class="alert alert-danger" role="alert">
&lt;h4 class="alert-heading">Required permissions&lt;/h4>
To bootstrap Flux, the person running the command must have &lt;strong>cluster admin rights&lt;/strong> for the target Kubernetes cluster.
It is also required that the person running the command to have &lt;strong>pull and push rights&lt;/strong> for the Oracle VBS Git repositories.
&lt;/div>
&lt;h2 id="oracle-vbs-pat">Oracle VBS PAT&lt;/h2>
&lt;p>For accessing the Oracle VBS, the bootstrap command requires an Oracle VBS personal access token (PAT)
with pull and push permissions for Git repositories.&lt;/p>
&lt;p>Generate an
&lt;a href="https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/Content/Identity/usersettings/generate-personal-access-tokens.htm" target="_blank">Oracle VBS Access Token&lt;/a>.
And create a new repository to hold your Flux install and other Kubernetes resources.&lt;/p>
&lt;p>The Oracle VBS PAT can be exported as an environment variable:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">export&lt;/span> &lt;span style="color:#bb60d5">GIT_PASSWORD&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;vbs-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>GIT_PASSWORD&lt;/code> env var is not set, the bootstrap command will prompt you to type the token.&lt;/p>
&lt;p>You can also supply the token using a pipe e.g. &lt;code>echo &amp;quot;&amp;lt;vbs-token&amp;gt;&amp;quot; | flux bootstrap git&lt;/code>.&lt;/p>
&lt;h2 id="bootstrap-using-an-oracle-vbs-pat">Bootstrap using an Oracle VBS PAT&lt;/h2>
&lt;p>Run the bootstrap for a repository using token-based authentication:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux bootstrap git &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --with-bearer-token&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#007020">true&lt;/span> &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://&amp;lt;vbs-repository-url&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --branch&lt;span style="color:#666">=&lt;/span>my-branch &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --path&lt;span style="color:#666">=&lt;/span>clusters/my-cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>When using &lt;code>--with-bearer-token&lt;/code>, the CLI and the Flux controllers running on the cluster will use the Oracle VBS PAT
to access the Git repository over HTTPS.&lt;/p>
&lt;p>Note that the Oracle VBS PAT is stored in the cluster as a &lt;strong>Kubernetes Secret&lt;/strong> named &lt;code>flux-system&lt;/code>
inside the &lt;code>flux-system&lt;/code> namespace.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Token rotation&lt;/h4>
&lt;p>Note that Oracle VBS PAT may have an expiry date if it was configured to have one.
To rotate the token before it expires,
delete the &lt;code>flux-system&lt;/code> secret from the cluster and recreate it with the new PAT:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux create secret git flux-system &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --url&lt;span style="color:#666">=&lt;/span>https://&amp;lt;vbs-repository-url&amp;gt; &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span> --bearer-token&lt;span style="color:#666">=&lt;/span>&amp;lt;vbs-token&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/div></description></item></channel></rss>