Skip to content

Commit

Permalink
Merge branch 'cilium:main' into pr/matthewhembree/add-helm-release-na…
Browse files Browse the repository at this point in the history
…me-flag
  • Loading branch information
matthewhembree committed Mar 19, 2024
2 parents a1409dd + 3d41bda commit 7ec19cb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,12 @@ jobs:
config: ${{ env.kind_config }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Set NODES_WITHOUT_CILIUM
run: |
# To add more elements, keep it comma-separated.
echo "NODES_WITHOUT_CILIUM=chart-testing-worker2,chart-testing-worker3" >> $GITHUB_ENV
# Install Cilium with HostPort support and enables Prometheus for extended connectivity test.
- name: Install Cilium
run: |
cilium install \
--version=${{ env.cilium_version }} \
--nodes-without-cilium="${NODES_WITHOUT_CILIUM}" \
--nodes-without-cilium \
--wait=false \
--set bpf.monitorAggregation=none \
--set cni.chainingMode=portmap \
Expand Down Expand Up @@ -138,7 +133,7 @@ jobs:
--from-literal=keys="3 rfc4106(gcm(aes)) $(echo $(dd if=/dev/urandom count=20 bs=1 2> /dev/null | xxd -p -c 64)) 128"
cilium install \
--version=${{ env.cilium_version}} \
--nodes-without-cilium="${NODES_WITHOUT_CILIUM}" \
--nodes-without-cilium \
--set encryption.enabled=true \
--set encryption.type=ipsec \
--set kubeProxyReplacement=false
Expand Down Expand Up @@ -250,7 +245,7 @@ jobs:
--set cni.chainingMode=portmap \
--set cluster.id=1 \
--set cluster.name=$CLUSTER1 \
--nodes-without-cilium=${{ env.CLUSTER_NAME_1 }}-worker2
--nodes-without-cilium
- name: Create kind cluster 2
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RELEASE_GID ?= $(shell id -g)

# renovate: datasource=docker depName=golang
GO_IMAGE_VERSION = 1.22.1-alpine3.19
GO_IMAGE_SHA = sha256:fc5e5848529786cf1136563452b33d713d5c60b2c787f6b2a077fa6eeefd9114
GO_IMAGE_SHA = sha256:0466223b8544fb7d4ff04748acc4d75a608234bf4e79563bff208d2060c0dd79

# renovate: datasource=docker depName=golangci/golangci-lint
GOLANGCILINT_WANT_VERSION = v1.56.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ binary releases.

| Release | Maintained | Compatible Cilium Versions |
|------------------------------------------------------------------------|------------|----------------------------|
| [v0.16.2](https://github.com/cilium/cilium-cli/releases/tag/v0.16.2) | Yes | Cilium 1.15 and newer |
| [v0.16.3](https://github.com/cilium/cilium-cli/releases/tag/v0.16.3) | Yes | Cilium 1.15 and newer |
| [v0.15.22](https://github.com/cilium/cilium-cli/releases/tag/v0.15.22) | Yes | Cilium 1.14 (*) |
| [v0.14.8](https://github.com/cilium/cilium-cli/releases/tag/v0.14.8) | Yes | Cilium 1.13 |

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ table](https://github.com/cilium/cilium-cli#releases) for the most recent suppor
Set `RELEASE` environment variable to the new version. This variable will be
used in the commands throughout the documenat to allow copy-pasting.

export RELEASE=v0.16.3
export RELEASE=v0.16.4

## Prepare the release

Expand Down
2 changes: 1 addition & 1 deletion cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func addCommonInstallFlags(cmd *cobra.Command, params *install.Parameters) {
cmd.Flags().StringVar(&params.Version, "version", defaults.Version, "Cilium version to install")
cmd.Flags().StringVar(&params.DatapathMode, "datapath-mode", "", "Datapath mode to use { tunnel | native | aws-eni | gke | azure | aks-byocni } (default: autodetected).")
cmd.Flags().BoolVar(&params.ListVersions, "list-versions", false, "List all the available versions without actually installing")
cmd.Flags().StringSliceVar(&params.NodesWithoutCilium, "nodes-without-cilium", []string{}, "List of node names on which Cilium will not be installed. In Helm installation mode, it's assumed that the no-schedule node labels are present and that the infrastructure has set up routing on these nodes to provide connectivity within the Cilium cluster.")
cmd.Flags().BoolVar(&params.NodesWithoutCilium, "nodes-without-cilium", false, "Configure the affinities to avoid scheduling Cilium components on nodes labeled with cilium.io/no-schedule. It is assumed that the infrastructure has set up routing on these nodes to provide connectivity within the Cilium cluster.")
}

// addCommonUninstallFlags adds uninstall command flags that are shared between classic and helm mode.
Expand Down
9 changes: 0 additions & 9 deletions install/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package install
import (
"fmt"

"github.com/cilium/cilium-cli/defaults"
"github.com/cilium/cilium-cli/internal/helm"
"github.com/cilium/cilium-cli/k8s"

Expand Down Expand Up @@ -111,13 +110,5 @@ func (k *K8sInstaller) getHelmValues() (map[string]interface{}, error) {
return nil, fmt.Errorf("cilium version unsupported %s", k.chartVersion)
}

// Set affinity to prevent Cilium from being scheduled on nodes labeled with
// "cilium.io/no-schedule=true"
if len(k.params.NodesWithoutCilium) != 0 {
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.CiliumScheduleAffinity...)
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.CiliumOperatorScheduleAffinity...)
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.SpireAgentScheduleAffinity...)
}

return helm.MergeVals(k.params.HelmOpts, helmMapOpts)
}
12 changes: 10 additions & 2 deletions install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ type Parameters struct {
// ListVersions lists all the available versions for install without actually installing.
ListVersions bool

// NodesWithoutCilium lists all nodes on which Cilium is not installed.
NodesWithoutCilium []string
// NodesWithoutCilium enables the affinities to avoid scheduling Cilium components on nodes labeled with cilium.io/no-schedule
NodesWithoutCilium bool

// DryRun writes resources to be installed to stdout without actually installing them. For Helm
// installation mode only.
Expand Down Expand Up @@ -235,6 +235,14 @@ func (k *K8sInstaller) preinstall(ctx context.Context) error {
}
}

// Set affinity to prevent Cilium from being scheduled on nodes labeled with
// "cilium.io/no-schedule=true"
if k.params.NodesWithoutCilium {
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.CiliumScheduleAffinity...)
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.CiliumOperatorScheduleAffinity...)
k.params.HelmOpts.StringValues = append(k.params.HelmOpts.StringValues, defaults.SpireAgentScheduleAffinity...)
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion stable.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.16.0
v0.16.3

0 comments on commit 7ec19cb

Please sign in to comment.