Skip to content
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
2 changes: 2 additions & 0 deletions .github/scripts/deploy-fleet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ eventually helm upgrade --install fleet charts/fleet \
--set insecureSkipHostKeyChecks=false \
--set-string extraEnv[0].name=EXPERIMENTAL_SCHEDULES \
--set-string extraEnv[0].value=true \
--set-string extraEnv[1].name=EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM \
--set-string extraEnv[1].value=true \
--set debug=true --set debugLevel=1

# wait for controller and agent rollout
Expand Down
106 changes: 106 additions & 0 deletions charts/fleet-crd/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,24 @@ spec:
nullable: true
type: array
type: object
downstreamResources:
description: 'DownstreamResources points to resources to be
copied into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for
a resource to be copied from the parent bundle''s namespace
to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down Expand Up @@ -672,6 +690,24 @@ spec:
nullable: true
type: array
type: object
downstreamResources:
description: 'DownstreamResources points to resources to be
copied into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for
a resource to be copied from the parent bundle''s namespace
to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down Expand Up @@ -1575,6 +1611,23 @@ spec:
nullable: true
type: array
type: object
downstreamResources:
description: 'DownstreamResources points to resources to be copied
into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for a resource
to be copied from the parent bundle''s namespace to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down Expand Up @@ -2464,6 +2517,24 @@ spec:
description: DoNotDeploy if set to true, will not deploy to
this target.
type: boolean
downstreamResources:
description: 'DownstreamResources points to resources to be
copied into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for
a resource to be copied from the parent bundle''s namespace
to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down Expand Up @@ -7466,6 +7537,23 @@ spec:
nullable: true
type: array
type: object
downstreamResources:
description: 'DownstreamResources points to resources to be copied
into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for a resource
to be copied from the parent bundle''s namespace to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down Expand Up @@ -8379,6 +8467,24 @@ spec:
description: DoNotDeploy if set to true, will not deploy to
this target.
type: boolean
downstreamResources:
description: 'DownstreamResources points to resources to be
copied into downstream clusters, from the bundle''s

namespace.'
items:
description: 'DownstreamResource contains identifiers for
a resource to be copied from the parent bundle''s namespace
to each

downstream cluster.'
properties:
kind:
type: string
name:
type: string
type: object
type: array
forceSyncGeneration:
description: ForceSyncGeneration is used to force a redeployment
format: int64
Expand Down
2 changes: 2 additions & 0 deletions charts/fleet/ci/debug-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ shards:
kubernetes.io/hostname: k3d-upstream-server-2

extraEnv:
- name: EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM
value: "true"
- name: EXPERIMENTAL_SCHEDULES
value: "true"
2 changes: 2 additions & 0 deletions charts/fleet/ci/nobootstrap-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ shards:
kubernetes.io/hostname: k3d-upstream-server-2

extraEnv:
- name: EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM
value: "true"
- name: EXPERIMENTAL_SCHEDULES
value: "true"
2 changes: 2 additions & 0 deletions charts/fleet/ci/nodebug-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ shards:
kubernetes.io/hostname: k3d-upstream-server-2

extraEnv:
- name: EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM
value: "true"
- name: EXPERIMENTAL_SCHEDULES
value: "true"
2 changes: 2 additions & 0 deletions charts/fleet/ci/nogitops-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ shards:
kubernetes.io/hostname: k3d-upstream-server-2

extraEnv:
- name: EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM
value: "true"
- name: EXPERIMENTAL_SCHEDULES
value: "true"
3 changes: 3 additions & 0 deletions charts/fleet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ spec:
- name: FLEET_AGENT_ELECTION_RENEW_DEADLINE
value: {{$.Values.agent.leaderElection.renewDeadline}}
{{- end }}
{{- if $.Values.extraEnv }}
{{ toYaml $.Values.extraEnv | indent 8}}
{{- end }}
image: '{{ template "system_default_registry" $ }}{{ $.Values.image.repository }}:{{ $.Values.image.tag }}'
name: fleet-agentmanagement
imagePullPolicy: "{{ $.Values.image.imagePullPolicy }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/fleet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ agent:
# extraEnv:
# - name: OCI_STORAGE
# value: "false"
# - name: EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM
# value: "false"

# shards:
# - id: shard0
Expand Down
2 changes: 2 additions & 0 deletions dev/setup-fleet
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ helm -n cattle-fleet-system upgrade --install --create-namespace --wait --reset-
--set insecureSkipHostKeyChecks=false \
--set-string extraEnv[0].name=EXPERIMENTAL_SCHEDULES \
--set-string extraEnv[0].value=true \
--set-string extraEnv[1].name=EXPERIMENTAL_COPY_RESOURCES_DOWNSTREAM \
--set-string extraEnv[1].value=true \
--set debug=true --set debugLevel=1 fleet charts/fleet

# wait for controller and agent rollout
Expand Down
42 changes: 42 additions & 0 deletions e2e/assets/multi-cluster/helmop_downstream_resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: fleet.cattle.io/v1alpha1
kind: HelmOp
metadata:
name: {{.Name}}
namespace: {{.Namespace}}
spec:
helm:
releaseName: testhelm-multi-cluster
repo: {{.Repo}}
chart: {{.Chart}}
version: '{{.Version}}'
valuesFrom:
{{- range $vf := .ValuesFrom}}
{{- if $vf.ConfigMapKeyRef }}
- configMapKeyRef:
namespace: {{$vf.ConfigMapKeyRef.Namespace}}
name: {{$vf.ConfigMapKeyRef.Name}}
key: {{$vf.ConfigMapKeyRef.Key}}
{{- end }}
{{- if $vf.SecretKeyRef }}
- secretKeyRef:
namespace: {{$vf.SecretKeyRef.Namespace}}
name: {{$vf.SecretKeyRef.Name}}
key: {{$vf.SecretKeyRef.Key}}
{{- end }}
{{- end}}
downstreamResources:
{{- range $dr := .DownstreamResources}}
- kind: {{$dr.Kind}}
name: {{$dr.Name}}
{{- end}}
keepResources: {{.KeepResources}}
pollingInterval: {{.PollingInterval}}
namespace: {{.Namespace}}
helmSecretName: {{.HelmSecretName}}
insecureSkipTLSVerify: {{.InsecureSkipTLSVerify}}

targets:
- name: test
clusterSelector:
matchLabels:
env: test
1 change: 1 addition & 0 deletions e2e/assets/multi-cluster/values-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: name-from-downstream-cluster-configmap
1 change: 1 addition & 0 deletions e2e/assets/multi-cluster/values-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: name-from-downstream-cluster-secret
Loading