Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

render: add --cloud-provider #105

Merged
merged 1 commit into from Nov 18, 2016

Conversation

kalbasit
Copy link
Contributor

No description provided.

@aaronlevy
Copy link
Contributor

@kalbasit I opened #106 to track some thoughts about how we can make configuration options like these potentially not require internal code changes. Let me know if you have any thoughts

@kalbasit
Copy link
Contributor Author

@aaronlevy I like the idea of #106 I'll think more about it and give my feedback there. --cloud-provider is going to be a very common flag, shouldn't be part of the default templates?

@@ -41,6 +41,9 @@ spec:
- --tls-private-key-file=/etc/kubernetes/secrets/apiserver.key
- --service-account-key-file=/etc/kubernetes/secrets/service-account.pub
- --client-ca-file=/etc/kubernetes/secrets/ca.crt
{{ with .CloudProvider -}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaronlevy the -}} is a Go 1.6+ feature, see golang/go#9969. Is that OK?

@kalbasit kalbasit force-pushed the allow-cloud-provider branch 2 times, most recently from 64056fc to 692c119 Compare September 28, 2016 23:18
@kalbasit kalbasit force-pushed the allow-cloud-provider branch 2 times, most recently from b7f16ee to 1709a6f Compare November 3, 2016 16:51
@kalbasit
Copy link
Contributor Author

kalbasit commented Nov 3, 2016

@aaronlevy bumping this to see if we can get it merged while waiting for a better solution than having to create a fork.

@aaronlevy
Copy link
Contributor

Hi @kalbasit

This is being partially implemented in: #186 -- but not yet exposed as a cli flag - as we might still need a bit more work for this to be plumbed through as a cli option. See my comments here: #186 (comment)

@kalbasit
Copy link
Contributor Author

kalbasit commented Nov 18, 2016

@aaronlevy why re-implement the same thing in another PR?

@aaronlevy
Copy link
Contributor

If you want to make the changes here, happy to merge this PR (yours was first). I'll make inline comments for changes that would be needed.

Then as far as exposing the flag -- we can move forward with it, but I do have a concern that the temporary control plane will not reflect the same options (and I'm unsure if this is a safe assumption at this time). I also don't think adding another flag to start is a safe alternative, because then there is just an implied assumption that same flags are used between commands (for it to work), but no actual enforcement of this.

@kalbasit
Copy link
Contributor Author

@aaronlevy I've been running a production cluster with this on since August and I had no problems so far.

I was thinking the other day about the flag and about #106, what if instead of exposing cloud-provider or any of the other flags, maybe we could expose --extra-api-flags, --extra-controller-flags, etc.. Thoughts?

@@ -51,6 +51,9 @@ spec:
- --kubeconfig=/etc/kubernetes/kubeconfig
- --require-kubeconfig
- --lock-file=/var/run/lock/kubelet.lock
{{ with .CloudProvider -}}
- --cloud-provider={{ . }}
{{ end -}}
Copy link
Contributor

@aaronlevy aaronlevy Nov 18, 2016

Choose a reason for hiding this comment

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

We should drop these changes from the self-hosted kubelet manifest. Otherwise the self-hosted kubelet could behave differently than the on-host kubelet (as documented). The kubelet should use "auto-detect" for both -- so no change should be necessary.

@@ -194,20 +200,29 @@ spec:
- --root-ca-file=/etc/kubernetes/secrets/ca.crt
- --service-account-private-key-file=/etc/kubernetes/secrets/service-account.key
- --leader-elect=true
{{ with .CloudProvider -}}
- --cloud-provider={{ . }}
{{ end -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Drop the with/end blocks.
The default cloud-provider is an empty string anyway. --cloud-provider={{ .CloudProvider }}

@@ -194,20 +200,29 @@ spec:
- --root-ca-file=/etc/kubernetes/secrets/ca.crt
- --service-account-private-key-file=/etc/kubernetes/secrets/service-account.key
- --leader-elect=true
{{ with .CloudProvider -}}
- --cloud-provider={{ . }}
{{ end -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should also add - --configure-cloud-routes=false which is safe to always be set (we assume flannel will handle managing routes).

volumeMounts:
- name: secrets
mountPath: /etc/kubernetes/secrets
readOnly: true
- name: ssl-host
mountPath: /etc/ssl/certs
readOnly: true
- name: resolv-conf
mountPath: /etc/resolv.conf
readOnly: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets use dnsPolicy: Default instead of the explicit host mount.

mustCreateAssetFromTemplate(AssetPathAPIServer, internal.APIServerTemplate, conf),
mustCreateAssetFromTemplate(AssetPathKubelet, internal.KubeletTemplate, conf),
Copy link
Contributor

Choose a reason for hiding this comment

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

kubelet shouldn't be templated if we're not going to pass in the cloud-provider flag to it.

@kalbasit
Copy link
Contributor Author

@aaronlevy PTAL

@@ -38,6 +38,7 @@ func newStaticAssets(selfHostKubelet bool) Assets {

func newDynamicAssets(conf Config) Assets {
return Assets{
mustCreateAssetFromTemplate(AssetPathControllerManager, internal.ControllerManagerTemplate, conf),
Copy link
Contributor

Choose a reason for hiding this comment

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

The controller-manager entry should also be removed from newStaticAssets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, must have bee a merge mistake at some point.

@kalbasit
Copy link
Contributor Author

@aaronlevy PTAL

@aaronlevy
Copy link
Contributor

lgtm. Thanks @kalbasit ! Can you squash your commits and I'll merge.

@kalbasit
Copy link
Contributor Author

@aaronlevy thanks for the quick review, very excited to have this merged (hard to maintain a fork :)). I squashed the commits.

@aaronlevy when will this make be released?

@aaronlevy aaronlevy merged commit cb22058 into kubernetes-retired:master Nov 18, 2016
@aaronlevy
Copy link
Contributor

@kalbasit I'll try and get a new release out today.

@kalbasit kalbasit deleted the allow-cloud-provider branch November 18, 2016 19:18
@kalbasit
Copy link
Contributor Author

@aaronlevy thank you!

@aaronlevy
Copy link
Contributor

@kalbasit sorry for the delay -- trying to work out some networking issues I'm seeing on vagrant/kube-proxy so want to fully understand issue before cutting a release

@kalbasit
Copy link
Contributor Author

@aaronlevy thank you for letting me know. I need the release at the beginning of December so please take your time and ping me once it has been released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants