Skip to content

calico: upstream pr preparation#7

Open
vsoch wants to merge 7 commits intodevelopfrom
calico-upstream-pr
Open

calico: upstream pr preparation#7
vsoch wants to merge 7 commits intodevelopfrom
calico-upstream-pr

Conversation

@vsoch
Copy link
Copy Markdown
Member

@vsoch vsoch commented Jan 25, 2026

I'm not sure if this will be possible, but I'm trying to cleanup our current calico install. I was able to install from a release and then apply our custom manifests, but (so far) haven't been able to do the entire thing cleanly with yq. It's a weird case of needing to apply the initial setup they have, but then remove it and re-apply the customizations, importantly keeping the IP: autodetect set so the calico.vxlan network shows up with ip addr. I am finding that when I try to patch from the getgo with yq I run into a myriad of errors. If I don't create our customizations with autodetect the network has issues too. I still think it might be possible, and the next step is to look closely at what we have for the individual configs here and compare with what is being installed upstream.

Update: I've now removed all custom manifests - we get the upstream manifest and make all changes with yq. There are quite a few, but I think this is probably the slimmiest I can get it for something to review / easily see changes.

vsoch and others added 5 commits January 22, 2026 12:50
The user can install calico (even using the same flannel
port) via a CRD for it, adding the rules for it, customizing
the Daemonset env and the addresses that the containers use.

Signed-off-by: vsoch <[email protected]>
@vsoch vsoch mentioned this pull request Jan 25, 2026
@vsoch vsoch force-pushed the calico-upstream-pr branch from 9efd023 to 602ebb4 Compare January 26, 2026 05:38
@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Feb 4, 2026

@AkihiroSuda please take a look at these changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be a daemonset?
Could be in https://github.com/rootless-containers/usernetes/tree/master/Dockerfile.d

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also had it as a COPY to the container via a udev rules files, but I don't think it took. At least whatever state changes the initial calico install triggered might have undone it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but we would need to name it something else so it's not specific to flannel.

#!/bin/bash

# Install standard Calico
CALICO_VERSION="v3.31"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# backend to vxlan
yq eval-all -i '(select(.kind == "ConfigMap" and .metadata.name == "calico-config").data.calico_backend) = "vxlan"' $CALICO_FILE

# IPIP and VXLAN
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs explanation

wget https://raw.githubusercontent.com/projectcalico/calico/refs/heads/release-v3.31/manifests/calico.yaml -O $CALICO_FILE

# backend to vxlan
yq eval-all -i '(select(.kind == "ConfigMap" and .metadata.name == "calico-config").data.calico_backend) = "vxlan"' $CALICO_FILE
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we tried for weeks to get helm working - it was too complex. If you want to try and are successful we can do some testing of what you find.

: "${CONTAINER_ENGINE_TYPE:=$("${detect_engine}" CONTAINER_ENGINE_TYPE)}"
: "${QUICK:=0}"

# Set to 1 since we will do calico by default
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should not change yet

kubectl taint nodes "${node}" node.cloudprovider.kubernetes.io/uninitialized-
fi
nodename=$(cut -d / -f 2 <<< $node)
calicoctl --allow-version-mismatch patch node ${nodename} --patch='{"spec": {"bgp":{"ipv4Address": "'"$host_ip"'"}}}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs explanation, and has to be skipped in non-calico setup

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does bgp matter here?

}


install_yq() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Dockerfile
gettext-base \
moreutils \
socat
socat ipset wget
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wget and curl should not be mixed up

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code comment should explain why ipset is needed

Comment thread Dockerfile
ADD Dockerfile.d/etc_udev_rules.d_95-calico.rules /etc/udev/rules.d/95-calico.rules
ADD Dockerfile.d/u7s-entrypoint.sh /
# Calico
ENV FELIX_IGNORELOOSERPF=true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only passed to the entrypoint script, so probably not effective

Comment thread README.md
```

- sysctl:
- sysctl (should not be required for calico, but needs testing)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doubtful

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants