Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: Mount /usr/local/share/ca-certificates folder into kube-controller-manager #4001

Merged
merged 5 commits into from Nov 4, 2020

Conversation

ericsuhong
Copy link
Contributor

Reason for Change:
To support airgap clouds, we need to mount /usr/local/share/ca-certificates folder into kube-controller-manager

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:
kube-controller-manager was working fine in airgap clouds on K8s 1.16 without requiring this change, so I assume this change is only needed for K8s 1.17+

@acs-bot acs-bot added the size/S label Nov 3, 2020
@ericsuhong ericsuhong changed the title Master 0.57.0 fix: Mount /usr/local/share/ca-certificates folder into kube-controller-manager Nov 3, 2020
Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot
Copy link

acs-bot commented Nov 3, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ericsuhong, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #4001 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4001   +/-   ##
=======================================
  Coverage   73.68%   73.68%           
=======================================
  Files         147      147           
  Lines       23161    23161           
=======================================
  Hits        17067    17067           
  Misses       4979     4979           
  Partials     1115     1115           
Impacted Files Coverage Δ
pkg/engine/templates_generated.go 48.97% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4262e4b...dc7fab1. Read the comment docs.

@jackfrancis jackfrancis merged commit d26bafe into Azure:master Nov 4, 2020
@jadarsie
Copy link
Member

jadarsie commented Nov 4, 2020

local i=1
for cert in $(echo $CUSTOM_CLOUD_ROOT_CERTIFICATES | tr ',' '\n')
do
echo $cert | base64 -d > "/usr/local/share/ca-certificates/customCloudRootCertificate$i.crt"
((i++))
done
update-ca-certificates

@ericsuhong, why is this ^^^ not enough? The man page for update-ca-certificates seems to indicates that the extra mount should not be required: http://manpages.ubuntu.com/manpages/xenial/man8/update-ca-certificates.8.html

@ericsuhong
Copy link
Contributor Author

@jadarsie We encountered this issue on Ubuntu 18.04 with K8s 1.18 in airgap cloud where if you download and update root certificates, cloud-controller won't recognize new root certs until we added that additional mount point.

ericsuhong added a commit to ericsuhong/aks-engine that referenced this pull request Nov 4, 2020
@jadarsie
Copy link
Member

jadarsie commented Nov 5, 2020

right, I understand the symptom, I just wonder why that's the case.
Is update-ca-certificates printing out a warning or error message?
Please let me know if eventually this becomes clear. Thx.

@ericsuhong
Copy link
Contributor Author

ericsuhong commented Nov 5, 2020

I will be honest, I could not pinpoint the root cause exactly. I also faced an issue where it sometimes required explicit node reboot for kube-controller-manager to reflect the cert update as well... (does not happen for other services running on agent nodes).

update-ca-certificates command did not print out any warning or error messages. It should not require node reboots neither...

For now, since this is a pretty safe change, I've decided to make this change and move on due to tight airgap deadlines.

ericsuhong added a commit to ericsuhong/aks-engine that referenced this pull request Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants