Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate arch flags in favor of multi-arch images #684

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/flux/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var (
bootstrapWatchAllNamespaces bool
bootstrapNetworkPolicy bool
bootstrapManifestsPath string
bootstrapArch = flags.Arch(defaults.Arch)
bootstrapArch flags.Arch
bootstrapLogLevel = flags.LogLevel(defaults.LogLevel)
bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"}
bootstrapTokenAuth bool
Expand Down Expand Up @@ -90,6 +90,7 @@ func init() {
bootstrapCmd.PersistentFlags().StringVar(&bootstrapManifestsPath, "manifests", "", "path to the manifest directory")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapClusterDomain, "cluster-domain", defaults.ClusterDomain, "internal cluster domain")
bootstrapCmd.PersistentFlags().MarkHidden("manifests")
bootstrapCmd.PersistentFlags().MarkDeprecated("arch", "multi-arch container image is now available for AMD64, ARMv7 and ARM64")
rootCmd.AddCommand(bootstrapCmd)
}

Expand Down Expand Up @@ -120,7 +121,6 @@ func generateInstallManifests(targetPath, namespace, tmpDir string, localManifes
Components: bootstrapComponents(),
Registry: bootstrapRegistry,
ImagePullSecret: bootstrapImagePullSecret,
Arch: bootstrapArch.String(),
WatchAllNamespaces: bootstrapWatchAllNamespaces,
NetworkPolicy: bootstrapNetworkPolicy,
LogLevel: bootstrapLogLevel.String(),
Expand Down
6 changes: 3 additions & 3 deletions cmd/flux/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
installImagePullSecret string
installWatchAllNamespaces bool
installNetworkPolicy bool
installArch = flags.Arch(defaults.Arch)
installArch flags.Arch
installLogLevel = flags.LogLevel(defaults.LogLevel)
installClusterDomain string
)
Expand All @@ -79,7 +79,6 @@ func init() {
installCmd.Flags().StringSliceVar(&installExtraComponents, "components-extra", nil,
"list of components in addition to those supplied or defaulted, accepts comma-separated values")
installCmd.Flags().StringVar(&installManifestsPath, "manifests", "", "path to the manifest directory")
installCmd.Flags().MarkHidden("manifests")
installCmd.Flags().StringVar(&installRegistry, "registry", defaults.Registry,
"container registry where the toolkit images are published")
installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "",
Expand All @@ -91,6 +90,8 @@ func init() {
installCmd.Flags().BoolVar(&installNetworkPolicy, "network-policy", defaults.NetworkPolicy,
"deny ingress access to the toolkit controllers from other namespaces using network policies")
installCmd.Flags().StringVar(&installClusterDomain, "cluster-domain", defaults.ClusterDomain, "internal cluster domain")
installCmd.Flags().MarkHidden("manifests")
installCmd.Flags().MarkDeprecated("arch", "multi-arch container image is now available for AMD64, ARMv7 and ARM64")
rootCmd.AddCommand(installCmd)
}

Expand Down Expand Up @@ -121,7 +122,6 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
Components: components,
Registry: installRegistry,
ImagePullSecret: installImagePullSecret,
Arch: installArch.String(),
WatchAllNamespaces: installWatchAllNamespaces,
NetworkPolicy: installNetworkPolicy,
LogLevel: installLogLevel.String(),
Expand Down
1 change: 0 additions & 1 deletion docs/cmd/flux_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
### Options

```
--arch arch cluster architecture, available options are: (amd64, arm, arm64) (default amd64)
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
--cluster-domain string internal cluster domain (default "cluster.local")
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
Expand Down
1 change: 0 additions & 1 deletion docs/cmd/flux_bootstrap_github.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ flux bootstrap github [flags]
### Options inherited from parent commands

```
--arch arch cluster architecture, available options are: (amd64, arm, arm64) (default amd64)
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
--cluster-domain string internal cluster domain (default "cluster.local")
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
Expand Down
1 change: 0 additions & 1 deletion docs/cmd/flux_bootstrap_gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ flux bootstrap gitlab [flags]
### Options inherited from parent commands

```
--arch arch cluster architecture, available options are: (amd64, arm, arm64) (default amd64)
--branch string default branch (for GitHub this must match the default branch setting for the organization) (default "main")
--cluster-domain string internal cluster domain (default "cluster.local")
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
Expand Down
1 change: 0 additions & 1 deletion docs/cmd/flux_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ flux install [flags]
### Options

```
--arch arch cluster architecture, available options are: (amd64, arm, arm64) (default amd64)
--cluster-domain string internal cluster domain (default "cluster.local")
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
Expand Down
8 changes: 4 additions & 4 deletions docs/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ flux bootstrap github \
--personal
```

!!! hint "ARM"
When deploying to a Kubernetes cluster with ARM architecture,
you can use `--arch=arm` for ARMv7 32-bit container images
and `--arch=arm64` for ARMv8 64-bit container images.
!!! hint "Multi-arch images"
The component images are published as [multi-arch container images](https://docs.docker.com/docker-for-mac/multi-arch/)
with support for Linux `amd64`, `arm64` and `armv7` (e.g. 32bit Raspberry Pi)
architectures.

The bootstrap command creates a repository if one doesn't exist,
commits the manifests for the Flux components to the default branch at the specified path,
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ flux bootstrap <GIT-PROVIDER> \
--version=latest
```

!!! hint "ARM"
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved
When deploying to a Kubernetes cluster with ARM architecture,
you can use `--arch=arm` for ARMv7 32-bit container images
and `--arch=arm64` for ARMv8 64-bit container images.
!!! hint "Multi-arch images"
The component images are published as [multi-arch container images](https://docs.docker.com/docker-for-mac/multi-arch/)
with support for Linux `amd64`, `arm64` and `armv7` (e.g. 32bit Raspberry Pi)
architectures.

If you wish to install a specific version, use the Flux
[release tag](https://github.com/fluxcd/flux2/releases) e.g. `--version=v0.2.0`.
Expand Down
2 changes: 0 additions & 2 deletions pkg/manifestgen/install/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type Options struct {
EventsAddr string
Registry string
ImagePullSecret string
Arch string
WatchAllNamespaces bool
NetworkPolicy bool
LogLevel string
Expand All @@ -47,7 +46,6 @@ func MakeDefaultOptions() Options {
EventsAddr: "",
Registry: "ghcr.io/fluxcd",
ImagePullSecret: "",
Arch: "amd64",
WatchAllNamespaces: true,
NetworkPolicy: true,
LogLevel: "info",
Expand Down
6 changes: 0 additions & 6 deletions pkg/manifestgen/install/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var kustomizationTmpl = `---
{{- $eventsAddr := .EventsAddr }}
{{- $watchAllNamespaces := .WatchAllNamespaces }}
{{- $registry := .Registry }}
{{- $arch := .Arch }}
{{- $logLevel := .LogLevel }}
{{- $clusterDomain := .ClusterDomain }}
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down Expand Up @@ -110,11 +109,7 @@ patchesJson6902:
images:
{{- range $i, $component := .Components }}
- name: fluxcd/{{$component}}
{{- if eq $arch "amd64" }}
newName: {{$registry}}/{{$component}}
{{- else }}
newName: {{$registry}}/{{$component}}-arm64
{{- end }}
{{- end }}
{{- end }}
`
Expand All @@ -136,7 +131,6 @@ spec:
template:
spec:
nodeSelector:
kubernetes.io/arch: {{.Arch}}
kubernetes.io/os: linux
{{- if .ImagePullSecret }}
imagePullSecrets:
Expand Down