-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run l7 controller on master #26048
Run l7 controller on master #26048
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -558,7 +558,6 @@ function start-kube-apiserver { | |
function start-kube-controller-manager { | ||
echo "Start kubernetes controller-manager" | ||
prepare-log-file /var/log/kube-controller-manager.log | ||
|
||
# Calculate variables and assemble the command line. | ||
local params="${CONTROLLER_MANAGER_TEST_LOG_LEVEL:-"--v=2"} ${CONTROLLER_MANAGER_TEST_ARGS:-}" | ||
params+=" --cloud-provider=gce" | ||
|
@@ -706,9 +705,6 @@ function start-kube-addons { | |
fi | ||
if [[ "${ENABLE_L7_LOADBALANCING:-}" == "glbc" ]]; then | ||
setup-addon-manifests "addons" "cluster-loadbalancing/glbc" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be moved into function start-lb-controller There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but then it won't start-lb-controller without the right env vars, which makes the function name a lie right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, no i guess it can. it splits addon deployment, but consolidates loadbalancer deployment. So ill send a follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for late comment, I just came back to office. It is not a functionality problem, just an improvement. So, you don't have to make a PR dedicated for the correction. It is up to you |
||
local -r glbc_yaml="${dst_dir}/cluster-loadbalancing/glbc/glbc.yaml" | ||
remove-salt-config-comments "${glbc_yaml}" | ||
sed -i -e "s@{{ *kube_uid *}}@${KUBE_UID:-}@g" "${glbc_yaml}" | ||
fi | ||
if [[ "${ENABLE_CLUSTER_DNS:-}" == "true" ]]; then | ||
setup-addon-manifests "addons" "dns" | ||
|
@@ -761,6 +757,17 @@ function start-fluentd { | |
fi | ||
} | ||
|
||
# Starts a l7 loadbalancing controller for ingress. | ||
function start-lb-controller { | ||
if [[ "${ENABLE_L7_LOADBALANCING:-}" == "glbc" ]]; then | ||
echo "Starting GCE L7 pod" | ||
prepare-log-file /var/log/glbc.log | ||
local -r src_file="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/glbc.manifest" | ||
cp "${src_file}" /etc/kubernetes/manifests/ | ||
fi | ||
} | ||
|
||
|
||
function reset-motd { | ||
# kubelet is installed both on the master and nodes, and the version is easy to parse (unlike kubectl) | ||
local -r version="$(/usr/bin/kubelet --version=true | cut -f2 -d " ")" | ||
|
@@ -829,6 +836,7 @@ if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then | |
start-kube-scheduler | ||
start-kube-addons | ||
start-cluster-autoscaler | ||
start-lb-controller | ||
else | ||
start-kube-proxy | ||
# Kube-registry-proxy. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: l7-lb-controller-v0.6.3 | ||
namespace: kube-system | ||
labels: | ||
k8s-app: glbc | ||
version: v0.6.3 | ||
kubernetes.io/cluster-service: "true" | ||
kubernetes.io/name: "GLBC" | ||
spec: | ||
terminationGracePeriodSeconds: 600 | ||
hostNetwork: true | ||
containers: | ||
- image: gcr.io/google_containers/glbc:0.6.3 | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8086 | ||
scheme: HTTP | ||
initialDelaySeconds: 30 | ||
# healthz reaches out to GCE | ||
periodSeconds: 30 | ||
timeoutSeconds: 5 | ||
name: l7-lb-controller | ||
volumeMounts: | ||
- mountPath: /etc/gce.conf | ||
name: cloudconfig | ||
readOnly: true | ||
- mountPath: /var/log/glbc.log | ||
name: logfile | ||
readOnly: false | ||
resources: | ||
# Request and limits are set to accomodate this pod alongside the other | ||
# master components on a single core master. | ||
limits: | ||
cpu: 50m | ||
memory: 100Mi | ||
requests: | ||
cpu: 10m | ||
memory: 50Mi | ||
command: | ||
# TODO: split this out into args when we no longer need to pipe stdout to a file #6428 | ||
- sh | ||
- -c | ||
- '/glbc --default-backend-service=kube-system/default-http-backend --sync-period=60s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1' | ||
volumes: | ||
- hostPath: | ||
path: /etc/gce.conf | ||
name: cloudconfig | ||
- hostPath: | ||
path: /var/log/glbc.log | ||
name: logfile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/etc/kubernetes/manifests/glbc.manifest: | ||
file.managed: | ||
- source: salt://l7-gcp/glbc.manifest | ||
- template: jinja | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
- makedirs: true | ||
- dir_mode: 755 | ||
|
||
/var/log/glbc.log: | ||
file.managed: | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If gke keeps re-salting clusters it defeats the purpose of file based persistence, and there are too many edge cases anway, so it's safer to maintain and allocate the uid in the l7 pod.