Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b981bae1db | ||
|
|
d2df9ccf33 | ||
|
|
5e51f51449 | ||
|
|
2c044a27e4 |
@@ -107,6 +107,7 @@ var (
|
||||
hrTargetNamespace string
|
||||
hrValuesFile string
|
||||
hrValuesFrom flags.HelmReleaseValuesFrom
|
||||
hrSAName string
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -116,6 +117,7 @@ func init() {
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
|
||||
createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrSAName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
|
||||
createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")
|
||||
createHelmReleaseCmd.Flags().Var(&hrValuesFrom, "values-from", hrValuesFrom.Description())
|
||||
createCmd.AddCommand(createHelmReleaseCmd)
|
||||
@@ -167,6 +169,10 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
|
||||
},
|
||||
}
|
||||
|
||||
if hrSAName != "" {
|
||||
helmRelease.Spec.ServiceAccountName = hrSAName
|
||||
}
|
||||
|
||||
if hrValuesFile != "" {
|
||||
data, err := ioutil.ReadFile(hrValuesFile)
|
||||
if err != nil {
|
||||
|
||||
@@ -88,13 +88,13 @@ var (
|
||||
|
||||
func init() {
|
||||
createKsCmd.Flags().Var(&ksSource, "source", ksSource.Description())
|
||||
createKsCmd.Flags().StringVar(&ksPath, "path", "./", "path to the directory containing the Kustomization file")
|
||||
createKsCmd.Flags().StringVar(&ksPath, "path", "./", "path to the directory containing a kustomization.yaml file")
|
||||
createKsCmd.Flags().BoolVar(&ksPrune, "prune", false, "enable garbage collection")
|
||||
createKsCmd.Flags().StringArrayVar(&ksHealthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
|
||||
createKsCmd.Flags().DurationVar(&ksHealthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
|
||||
createKsCmd.Flags().StringVar(&ksValidation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
|
||||
createKsCmd.Flags().StringArrayVar(&ksDependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'")
|
||||
createKsCmd.Flags().StringVar(&ksSAName, "sa-name", "", "service account name")
|
||||
createKsCmd.Flags().StringVar(&ksSAName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization")
|
||||
createKsCmd.Flags().Var(&ksDecryptionProvider, "decryption-provider", ksDecryptionProvider.Description())
|
||||
createKsCmd.Flags().StringVar(&ksDecryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
|
||||
createKsCmd.Flags().StringVar(&ksTargetNamespace, "target-namespace", "", "overrides the namespace of all Kustomization objects reconciled by this Kustomization")
|
||||
|
||||
@@ -75,6 +75,7 @@ flux create helmrelease [name] [flags]
|
||||
--depends-on stringArray HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'
|
||||
-h, --help help for helmrelease
|
||||
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
|
||||
--service-account string the name of the service account to impersonate when reconciling this HelmRelease
|
||||
--source helmChartSource source that contains the chart in the format '<kind>/<name>',where kind can be one of: (HelmRepository, GitRepository, Bucket)
|
||||
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
|
||||
--values string local path to the values.yaml file
|
||||
|
||||
@@ -50,9 +50,9 @@ flux create kustomization [name] [flags]
|
||||
--health-check stringArray workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'
|
||||
--health-check-timeout duration timeout of health checking operations (default 2m0s)
|
||||
-h, --help help for kustomization
|
||||
--path string path to the directory containing the Kustomization file (default "./")
|
||||
--path string path to the directory containing a kustomization.yaml file (default "./")
|
||||
--prune enable garbage collection
|
||||
--sa-name string service account name
|
||||
--service-account string the name of the service account to impersonate when reconciling this Kustomization
|
||||
--source kustomizationSource source that contains the Kubernetes manifests in the format '[<kind>/]<name>',where kind can be one of: (GitRepository, Bucket), if kind is not specified it defaults to GitRepository
|
||||
--target-namespace string overrides the namespace of all Kustomization objects reconciled by this Kustomization
|
||||
--validation string validate the manifests before applying them on the cluster, can be 'client' or 'server'
|
||||
|
||||
@@ -439,6 +439,12 @@ For testing purposes you can install Flux without storing its manifests in a Git
|
||||
flux install --arch=amd64
|
||||
```
|
||||
|
||||
Or using kustomize and kubectl:
|
||||
|
||||
```sh
|
||||
kustomize build https://github.com/fluxcd/flux2/manifests/install?ref=main | kubectl apply -f-
|
||||
```
|
||||
|
||||
Then you can register Git repositories and reconcile them on your cluster:
|
||||
|
||||
```sh
|
||||
@@ -473,12 +479,75 @@ flux create helmrelease nginx \
|
||||
--chart-version="5.x.x"
|
||||
```
|
||||
|
||||
## Monitoring with Prometheus and Grafana
|
||||
## Upgrade
|
||||
|
||||
Flux comes with a monitoring stack composed of Prometheus and Grafana. The controllers expose
|
||||
metrics that can be used to track the readiness of the cluster reconciliation process.
|
||||
Update Flux CLI to the latest release with `brew upgrade fluxcd/tap/flux` or by
|
||||
downloading the binary from [GitHub](https://github.com/fluxcd/flux2/releases).
|
||||
|
||||
To install the monitoring stack please follow this [guide](monitoring.md).
|
||||
Verify that you are running the latest version with:
|
||||
|
||||
```sh
|
||||
flux --version
|
||||
```
|
||||
|
||||
### Bootstrap upgrade
|
||||
|
||||
If you've used the [bootstrap](#bootstrap) procedure to deploy Flux,
|
||||
then rerun the bootstrap command for each cluster using the same arguments as before:
|
||||
|
||||
```sh
|
||||
flux bootstrap github \
|
||||
--owner=my-github-username \
|
||||
--repository=my-repository \
|
||||
--branch=main \
|
||||
--path=clusters/my-cluster \
|
||||
--personal
|
||||
```
|
||||
|
||||
The above command will clone the repository, it will update the components manifest in
|
||||
`<path>/flux-system/gotk-components.yaml` and it will push the changes to the remote branch.
|
||||
|
||||
Tell Flux to pull the manifests from Git and upgrade itself with:
|
||||
|
||||
```sh
|
||||
flux reconcile source git flux-system
|
||||
```
|
||||
|
||||
Verify that the controllers have been upgrade with:
|
||||
|
||||
```sh
|
||||
flux check
|
||||
```
|
||||
|
||||
### Terraform upgrade
|
||||
|
||||
Update the Flux provider to the [latest release](https://github.com/fluxcd/terraform-provider-flux/releases)
|
||||
and run `terraform apply`.
|
||||
|
||||
Tell Flux to upgrade itself in-cluster or wait for it to pull the latest commit from Git:
|
||||
|
||||
```sh
|
||||
kubectl annotate --overwrite gitrepository/flux-system reconcile.fluxcd.io/requestedAt="$(date +%s)"
|
||||
```
|
||||
|
||||
### In-cluster upgrade
|
||||
|
||||
If you've installed Flux directly on the cluster, then rerun the install command:
|
||||
|
||||
```sh
|
||||
flux install --version=latest
|
||||
```
|
||||
|
||||
The above command will download the latest manifests from
|
||||
[GitHub](https://github.com/fluxcd/flux2/releases) and it will apply them on your cluster.
|
||||
You can verify that the controllers have been upgraded to the latest version with `flux check`.
|
||||
|
||||
If you've installed Flux directly on the cluster with kubectl,
|
||||
then rerun the command using the latest manifests from the `main` branch:
|
||||
|
||||
```sh
|
||||
kustomize build https://github.com/fluxcd/flux2/manifests/install?ref=main | kubectl apply -f-
|
||||
```
|
||||
|
||||
## Uninstall
|
||||
|
||||
|
||||
Reference in New Issue
Block a user