Merge pull request #684 from fluxcd/multi-arch-image

Deprecate arch flags in favor of multi-arch images
pull/712/head
Hidde Beydals 4 years ago committed by GitHub
commit 9228130f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,7 +55,7 @@ var (
bootstrapWatchAllNamespaces bool bootstrapWatchAllNamespaces bool
bootstrapNetworkPolicy bool bootstrapNetworkPolicy bool
bootstrapManifestsPath string bootstrapManifestsPath string
bootstrapArch = flags.Arch(defaults.Arch) bootstrapArch flags.Arch
bootstrapLogLevel = flags.LogLevel(defaults.LogLevel) bootstrapLogLevel = flags.LogLevel(defaults.LogLevel)
bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"} bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"}
bootstrapTokenAuth bool bootstrapTokenAuth bool
@ -90,6 +90,7 @@ func init() {
bootstrapCmd.PersistentFlags().StringVar(&bootstrapManifestsPath, "manifests", "", "path to the manifest directory") bootstrapCmd.PersistentFlags().StringVar(&bootstrapManifestsPath, "manifests", "", "path to the manifest directory")
bootstrapCmd.PersistentFlags().StringVar(&bootstrapClusterDomain, "cluster-domain", defaults.ClusterDomain, "internal cluster domain") bootstrapCmd.PersistentFlags().StringVar(&bootstrapClusterDomain, "cluster-domain", defaults.ClusterDomain, "internal cluster domain")
bootstrapCmd.PersistentFlags().MarkHidden("manifests") bootstrapCmd.PersistentFlags().MarkHidden("manifests")
bootstrapCmd.PersistentFlags().MarkDeprecated("arch", "multi-arch container image is now available for AMD64, ARMv7 and ARM64")
rootCmd.AddCommand(bootstrapCmd) rootCmd.AddCommand(bootstrapCmd)
} }
@ -120,7 +121,6 @@ func generateInstallManifests(targetPath, namespace, tmpDir string, localManifes
Components: bootstrapComponents(), Components: bootstrapComponents(),
Registry: bootstrapRegistry, Registry: bootstrapRegistry,
ImagePullSecret: bootstrapImagePullSecret, ImagePullSecret: bootstrapImagePullSecret,
Arch: bootstrapArch.String(),
WatchAllNamespaces: bootstrapWatchAllNamespaces, WatchAllNamespaces: bootstrapWatchAllNamespaces,
NetworkPolicy: bootstrapNetworkPolicy, NetworkPolicy: bootstrapNetworkPolicy,
LogLevel: bootstrapLogLevel.String(), LogLevel: bootstrapLogLevel.String(),

@ -62,7 +62,7 @@ var (
installImagePullSecret string installImagePullSecret string
installWatchAllNamespaces bool installWatchAllNamespaces bool
installNetworkPolicy bool installNetworkPolicy bool
installArch = flags.Arch(defaults.Arch) installArch flags.Arch
installLogLevel = flags.LogLevel(defaults.LogLevel) installLogLevel = flags.LogLevel(defaults.LogLevel)
installClusterDomain string installClusterDomain string
) )
@ -79,7 +79,6 @@ func init() {
installCmd.Flags().StringSliceVar(&installExtraComponents, "components-extra", nil, installCmd.Flags().StringSliceVar(&installExtraComponents, "components-extra", nil,
"list of components in addition to those supplied or defaulted, accepts comma-separated values") "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().StringVar(&installManifestsPath, "manifests", "", "path to the manifest directory")
installCmd.Flags().MarkHidden("manifests")
installCmd.Flags().StringVar(&installRegistry, "registry", defaults.Registry, installCmd.Flags().StringVar(&installRegistry, "registry", defaults.Registry,
"container registry where the toolkit images are published") "container registry where the toolkit images are published")
installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "", installCmd.Flags().StringVar(&installImagePullSecret, "image-pull-secret", "",
@ -91,6 +90,8 @@ func init() {
installCmd.Flags().BoolVar(&installNetworkPolicy, "network-policy", defaults.NetworkPolicy, installCmd.Flags().BoolVar(&installNetworkPolicy, "network-policy", defaults.NetworkPolicy,
"deny ingress access to the toolkit controllers from other namespaces using network policies") "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().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) rootCmd.AddCommand(installCmd)
} }
@ -121,7 +122,6 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
Components: components, Components: components,
Registry: installRegistry, Registry: installRegistry,
ImagePullSecret: installImagePullSecret, ImagePullSecret: installImagePullSecret,
Arch: installArch.String(),
WatchAllNamespaces: installWatchAllNamespaces, WatchAllNamespaces: installWatchAllNamespaces,
NetworkPolicy: installNetworkPolicy, NetworkPolicy: installNetworkPolicy,
LogLevel: installLogLevel.String(), LogLevel: installLogLevel.String(),

@ -9,7 +9,6 @@ The bootstrap sub-commands bootstrap the toolkit components on the targeted Git
### Options ### 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") --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") --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 strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])

@ -61,7 +61,6 @@ flux bootstrap github [flags]
### Options inherited from parent commands ### 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") --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") --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 strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])

@ -57,7 +57,6 @@ flux bootstrap gitlab [flags]
### Options inherited from parent commands ### 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") --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") --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 strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])

@ -31,7 +31,6 @@ flux install [flags]
### Options ### Options
``` ```
--arch arch cluster architecture, available options are: (amd64, arm, arm64) (default amd64)
--cluster-domain string internal cluster domain (default "cluster.local") --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 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 --components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values

@ -92,10 +92,10 @@ flux bootstrap github \
--personal --personal
``` ```
!!! hint "ARM" !!! hint "Multi-arch images"
When deploying to a Kubernetes cluster with ARM architecture, The component images are published as [multi-arch container images](https://docs.docker.com/docker-for-mac/multi-arch/)
you can use `--arch=arm` for ARMv7 32-bit container images with support for Linux `amd64`, `arm64` and `armv7` (e.g. 32bit Raspberry Pi)
and `--arch=arm64` for ARMv8 64-bit container images. architectures.
The bootstrap command creates a repository if one doesn't exist, 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, commits the manifests for the Flux components to the default branch at the specified path,

@ -62,10 +62,10 @@ flux bootstrap <GIT-PROVIDER> \
--version=latest --version=latest
``` ```
!!! hint "ARM" !!! hint "Multi-arch images"
When deploying to a Kubernetes cluster with ARM architecture, The component images are published as [multi-arch container images](https://docs.docker.com/docker-for-mac/multi-arch/)
you can use `--arch=arm` for ARMv7 32-bit container images with support for Linux `amd64`, `arm64` and `armv7` (e.g. 32bit Raspberry Pi)
and `--arch=arm64` for ARMv8 64-bit container images. architectures.
If you wish to install a specific version, use the Flux 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`. [release tag](https://github.com/fluxcd/flux2/releases) e.g. `--version=v0.2.0`.

@ -27,7 +27,6 @@ type Options struct {
EventsAddr string EventsAddr string
Registry string Registry string
ImagePullSecret string ImagePullSecret string
Arch string
WatchAllNamespaces bool WatchAllNamespaces bool
NetworkPolicy bool NetworkPolicy bool
LogLevel string LogLevel string
@ -47,7 +46,6 @@ func MakeDefaultOptions() Options {
EventsAddr: "", EventsAddr: "",
Registry: "ghcr.io/fluxcd", Registry: "ghcr.io/fluxcd",
ImagePullSecret: "", ImagePullSecret: "",
Arch: "amd64",
WatchAllNamespaces: true, WatchAllNamespaces: true,
NetworkPolicy: true, NetworkPolicy: true,
LogLevel: "info", LogLevel: "info",

@ -28,7 +28,6 @@ var kustomizationTmpl = `---
{{- $eventsAddr := .EventsAddr }} {{- $eventsAddr := .EventsAddr }}
{{- $watchAllNamespaces := .WatchAllNamespaces }} {{- $watchAllNamespaces := .WatchAllNamespaces }}
{{- $registry := .Registry }} {{- $registry := .Registry }}
{{- $arch := .Arch }}
{{- $logLevel := .LogLevel }} {{- $logLevel := .LogLevel }}
{{- $clusterDomain := .ClusterDomain }} {{- $clusterDomain := .ClusterDomain }}
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
@ -110,11 +109,7 @@ patchesJson6902:
images: images:
{{- range $i, $component := .Components }} {{- range $i, $component := .Components }}
- name: fluxcd/{{$component}} - name: fluxcd/{{$component}}
{{- if eq $arch "amd64" }}
newName: {{$registry}}/{{$component}} newName: {{$registry}}/{{$component}}
{{- else }}
newName: {{$registry}}/{{$component}}-arm64
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
` `
@ -136,7 +131,6 @@ spec:
template: template:
spec: spec:
nodeSelector: nodeSelector:
kubernetes.io/arch: {{.Arch}}
kubernetes.io/os: linux kubernetes.io/os: linux
{{- if .ImagePullSecret }} {{- if .ImagePullSecret }}
imagePullSecrets: imagePullSecrets:

Loading…
Cancel
Save