Skip to content
Open
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
30 changes: 28 additions & 2 deletions deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ spec:
k8s-app: cloud-controller-manager
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
Expand All @@ -157,6 +157,9 @@ spec:
- --leader-elect=true
- --cloud-provider=external-cloudstack
- --cloud-config=/config/cloud-config
ports:
- name: https
containerPort: 10258
resources:
limits:
cpu: 50m
Expand All @@ -167,6 +170,17 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /config
hostNetwork: true
# use the node's resolver: CoreDNS may not be running before the nodes are initialised
dnsPolicy: Default
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
restartPolicy: Always
serviceAccountName: cloud-controller-manager
terminationGracePeriodSeconds: 30
Expand All @@ -179,3 +193,15 @@ spec:
- key: node.cloudprovider.kubernetes.io/uninitialized
value: "true"
effect: NoSchedule
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoSchedule
- key: node.kubernetes.io/network-unavailable
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
8 changes: 4 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ Generates two `cloud-config` files that differ **only in `api-url`**:
* `hack/e2e/_out/cloud-config-host` — used when you run the CCM as a host
process, pointing at `http://localhost:8080/client/api`.

The in-cluster config must use the simulator's **IP address**, not its
container name or network alias: pods have their own network namespace and
cannot reach Docker's embedded DNS resolver, and `host.docker.internal` does
not exist on Linux Docker Engine.
The in-cluster config uses the simulator's **IP address**, not its
container name or network alias. The CCM runs on the host network with the
kind node's resolver, and an IP works whatever DNS that node is given;
`host.docker.internal` does not exist on Linux Docker Engine.

Both configs set `zone` explicitly. If `zone` is empty the CCM tries to
detect it by looking up its own pod, which cannot work when running as a host
Expand Down
6 changes: 3 additions & 3 deletions hack/e2e/40-ccm-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ source "${E2E_ROOT}/lib/log.sh"
# shellcheck source=/dev/null
source "${E2E_OUT}/keys.env" 2>/dev/null || die "missing ${E2E_OUT}/keys.env — run 10-simulator-up.sh first"

# The CCM pod must reach the simulator via its IP on the shared docker
# network: pods cannot resolve docker's embedded DNS, and host.docker.internal
# does not exist on Linux.
# The CCM pod reaches the simulator via its IP on the shared docker network,
# which works whatever DNS the kind node is given; host.docker.internal does
# not exist on Linux.
sim_ip="$(docker inspect -f "{{(index .NetworkSettings.Networks \"${E2E_NET}\").IPAddress}}" "$SIM_NAME")"
[[ -n "$sim_ip" ]] || die "could not determine simulator IP on ${E2E_NET}"

Expand Down