Skip to content

Commit

Permalink
Merge branch 'main' into release/v0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Jul 23, 2024
2 parents aa1956a + 14b88bc commit 1bc51bf
Show file tree
Hide file tree
Showing 53 changed files with 1,398 additions and 1,132 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

-
name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.3.0
-
name: Run chart-testing (lint)
run: ct lint --all --validate-maintainers=false charts/
-
uses: actions/setup-go@v5
with:
Expand Down
19 changes: 3 additions & 16 deletions .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
name: E2E Fleet

on:
workflow_dispatch:
inputs:
enable_tmate:
description: 'Enable debugging via tmate'
required: false
default: "false"
pull_request:
push:
branches:
Expand All @@ -16,7 +10,7 @@ on:
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3D_VERSION: 'v5.7.1'

jobs:
e2e-fleet-test:
Expand All @@ -27,7 +21,7 @@ jobs:
k3s_version:
# k3d version list k3s | sed 's/+/-/' | sort -h
# https://hub.docker.com/r/rancher/k3s/tags
- v1.29.0-k3s1
- v1.30.2-k3s2
- v1.24.17-k3s1
test_type:
- name: default
Expand Down Expand Up @@ -77,13 +71,6 @@ jobs:
name: Import Images Into k3d
run: |
./.github/scripts/k3d-import-retry.sh rancher/fleet:dev rancher/fleet-agent:dev nginx-git:test -c upstream
-
name: Set Up Tmate Debug Session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
-
name: Deploy Fleet
env:
Expand Down Expand Up @@ -185,7 +172,7 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: gha-fleet-e2e-logs-${{ github.sha }}-${{ matrix.k3s_version }}-${{ github.run_id }}
name: gha-fleet-e2e-logs-${{ github.sha }}-${{ matrix.k3s_version }}-${{ matrix.test_type.name }}-${{ github.run_id }}
path: |
tmp/*.json
tmp/*.log
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/e2e-fleet-upgrade-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,20 @@ name: E2E Upgrade Fleet Standalone to HEAD
on:
schedule:
- cron: '0 8 */2 * *'
workflow_dispatch:
inputs:
enable_tmate:
description: 'Enable debugging via tmate'
required: false
default: "false"
pull_request:

env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3D_VERSION: 'v5.7.1'

jobs:
fleet-upgrade-test:
runs-on: ubuntu-latest
strategy:
matrix:
k3s_version:
- v1.27.5-k3s1
- v1.30.2-k3s2
steps:
-
uses: actions/checkout@v4
Expand All @@ -48,13 +42,6 @@ jobs:
--agents 1
--network "nw01"
--image docker.io/rancher/k3s:${{matrix.k3s_version}}
-
name: Set Up Tmate Debug Session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
-
name: Deploy Latest Release
run: |
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/e2e-multicluster-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ on:
schedule:
# Run everyday day at 9:00 AM
- cron: '0 9 * * *'
workflow_dispatch:
inputs:
enable_tmate:
description: 'Enable debugging via tmate'
required: false
default: "false"
pull_request:
push:
branches:
Expand All @@ -18,7 +12,7 @@ on:
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3D_VERSION: 'v5.7.1'

jobs:
e2e-fleet-mc-test:
Expand Down Expand Up @@ -87,13 +81,6 @@ jobs:
./.github/scripts/k3d-import-retry.sh rancher/fleet:dev rancher/fleet-agent:dev -c upstream
./.github/scripts/k3d-import-retry.sh rancher/fleet-agent:dev -c downstream
./.github/scripts/k3d-import-retry.sh rancher/fleet-agent:dev -c managed-downstream
-
name: Set Up Tmate Debug Session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
-
name: Deploy Fleet
run: |
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/e2e-nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ on:
schedule:
# Run everyday day at 7:00 AM
- cron: '0 7 * * *'
workflow_dispatch:
inputs:
enable_tmate:
description: 'Enable debugging via tmate'
required: false
default: "false"

env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3D_VERSION: 'v5.7.1'

jobs:
e2e-fleet-test:
Expand All @@ -25,8 +19,8 @@ jobs:
k3s_version:
# k3d version list k3s | sed 's/+/-/' | sort -h
# https://hub.docker.com/r/rancher/k3s/tags
- v1.30.2-k3s2
- v1.27.5-k3s1
- v1.26.8-k3s1
- v1.24.17-k3s1
test_type:
- acceptance
Expand Down Expand Up @@ -73,13 +67,6 @@ jobs:
name: Import Images Into k3d
run: |
./.github/scripts/k3d-import-retry.sh rancher/fleet:dev rancher/fleet-agent:dev nginx-git:test -c upstream
-
name: Set Up Tmate Debug Session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
-
name: Deploy Fleet
run: |
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/e2e-rancher-upgrade-fleet-to-head-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
description: "checkout git branch/tag"
required: true
default: "main"
enable_tmate:
description: 'Enable debugging via tmate'
required: false
default: "false"
push:
tags: [ 'v*' ]
paths-ignore:
Expand All @@ -23,8 +19,8 @@ on:
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3S_VERSION: 'v1.26.8-k3s1'
SETUP_K3D_VERSION: 'v5.7.1'
SETUP_K3S_VERSION: 'v1.30.2-k3s2'

jobs:
rancher-fleet-integration:
Expand Down Expand Up @@ -137,13 +133,6 @@ jobs:
--k3s-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%@agent:*'
--network "nw01"
--image docker.io/rancher/k3s:${{ env.SETUP_K3S_VERSION }}
-
name: Set up tmate debug session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true
-
name: Set up latest Rancher
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-rancher-upgrade-fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
SETUP_K3D_VERSION: 'v5.7.1'

jobs:
rancher-fleet-upgrade:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ Fleet expects its Go code to be formatted with `goimports`.
Fleet further follows the style guidelines at

- [Effective Go](https://go.dev/doc/effective_go) and
- [Go Wiki Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)
- [Go Wiki Code Review Comments](https://go.dev/wiki/CodeReviewComments)
- [Go Style At Google](https://google.github.io/styleguide/go/guide)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Install the Fleet Helm charts (there's two because we separate out CRDs for ulti

```shell
helm -n cattle-fleet-system install --create-namespace --wait \
fleet-crd https://github.com/rancher/fleet/releases/download/v0.9.5/fleet-crd-0.9.5.tgz
fleet-crd https://github.com/rancher/fleet/releases/download/v0.10.0/fleet-crd-0.10.0.tgz
helm -n cattle-fleet-system install --create-namespace --wait \
fleet https://github.com/rancher/fleet/releases/download/v0.9.5/fleet-0.9.5.tgz
fleet https://github.com/rancher/fleet/releases/download/v0.10.0/fleet-0.10.0.tgz
```

## Add a Git Repo to watch
Expand Down
2 changes: 2 additions & 0 deletions charts/fleet-agent/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.helmignore
ci/
2 changes: 2 additions & 0 deletions charts/fleet-agent/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apiServerURL: "https://localhost"
apiServerCA: "abc"
3 changes: 3 additions & 0 deletions charts/fleet-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ spec:
- name: kube
emptyDir: {}
serviceAccountName: fleet-agent
{{- if .Values.fleetAgent.hostNetwork }}
hostNetwork: true
{{- end }}
nodeSelector: {{ include "linux-node-selector" . | nindent 8 }}
{{- if .Values.fleetAgent.nodeSelector }}
{{ toYaml .Values.fleetAgent.nodeSelector | indent 8 }}
Expand Down
7 changes: 5 additions & 2 deletions charts/fleet-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ agentTLSMode: "system-store"
token: ""

# Labels to add to the cluster upon registration only. They are not added after the fact.
#labels:
# foo: bar
# labels:
# foo: bar

# The client ID of the cluster to associate with
clientID: ""
Expand All @@ -44,6 +44,9 @@ fleetAgent:
nodeSelector: {}
## List of node taints to tolerate (requires Kubernetes >= 1.6)
tolerations: []
## HostNetwork setting for the agent deployment.
## When set allows for provisioning of network related bundles (CNI configuration) in a cluster without CNI.
hostNetwork: false
kubectl:
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
Expand Down
17 changes: 17 additions & 0 deletions charts/fleet-crd/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5440,6 +5440,13 @@ spec:
either be predefined, or generated when importing the cluster.'
nullable: true
type: string
hostNetwork:
description: 'HostNetwork sets the agent StatefulSet to use hostNetwork:
true setting.
Allows for provisioning of network related bundles (CNI configuration).'
nullable: true
type: boolean
kubeConfigSecret:
description: 'KubeConfigSecret is the name of the secret containing
the kubeconfig for the downstream cluster.
Expand Down Expand Up @@ -5522,6 +5529,11 @@ spec:
used to detect changes.
nullable: true
type: string
agentHostNetwork:
description: AgentHostNetwork defines observed state of spec.hostNetwork
setting that is currently used.
nullable: true
type: boolean
agentMigrated:
description: 'AgentMigrated is always set to true after importing
a cluster. If
Expand Down Expand Up @@ -6490,6 +6502,11 @@ spec:
description: GitJobStatus is the status of the last Git job run,
e.g. "Current" if there was no error.
type: string
lastPollingTriggered:
description: LastPollingTime is the last time the polling check
was triggered
format: date-time
type: string
lastSyncedImageScanTime:
description: LastSyncedImageScanTime is the time of the last image
scan.
Expand Down
2 changes: 2 additions & 0 deletions charts/fleet/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.helmignore
ci/
64 changes: 64 additions & 0 deletions charts/fleet/ci/debug-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
bootstrap:
enabled: true

global:
cattle:
systemDefaultRegistry: "ghcr.io"

nodeSelector:
kubernetes.io/os: os2

tolerations:
- key: node.cloudprovider.kubernetes.io/uninitialized
operator: "Equal"
value: "true"
effect: NoSchedule

priorityClassName: "prio1"

gitops:
enabled: true

metrics:
enabled: true

debug: true
debugLevel: 4
propagateDebugSettingsToAgents: true

cpuPprof:
period: "60s"
volumeConfiguration:
hostPath:
path: /tmp/pprof
type: DirectoryOrCreate

migrations:
clusterRegistrationCleanup: true

leaderElection:
leaseDuration: 30s
retryPeriod: 10s
renewDeadline: 25s

controller:
reconciler:
workers:
gitrepo: "1"
bundle: "1"
bundledeployment: "1"

extraEnv:
- name: EXPERIMENTAL_OCI_STORAGE
value: "true"

shards:
- id: shard0
nodeSelector:
kubernetes.io/hostname: k3d-upstream-server-0
- id: shard1
nodeSelector:
kubernetes.io/hostname: k3d-upstream-server-1
- id: shard2
nodeSelector:
kubernetes.io/hostname: k3d-upstream-server-2
Empty file.
Loading

0 comments on commit 1bc51bf

Please sign in to comment.