Add ip-masq-agent addon to the addons folder. This also

ensures that under gce we add this daemonset if the non-masq-cidr
is set to 0/0.
This commit is contained in:
Daniel Nardo
2017-05-18 10:06:04 -07:00
parent 97889d4ff9
commit 96ae34685e
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
# https://github.com/kubernetes-incubator/ip-masq-agent/blob/v2.0.0/README.md
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: ip-masq-agent
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
template:
metadata:
labels:
k8s-app: ip-masq-agent
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: |
[{"key": "dedicated", "value": "master", "effect": "NoSchedule" },
{"key":"CriticalAddonsOnly", "operator":"Exists"}]
spec:
hostNetwork: true
containers:
- name: ip-masq-agent
image: gcr.io/google-containers/ip-masq-agent-amd64:v2.0.0
securityContext:
privileged: true
volumeMounts:
- name: config
mountPath: /etc/config
volumes:
- name: config
configMap:
# Note this ConfigMap must be created in the same namespace as the daemon pods - this spec uses kube-system
name: ip-masq-agent
optional: true
items:
# The daemon looks for its config in a YAML file at /etc/config/ip-masq-agent
- key: config
path: ip-masq-agent

View File

@@ -1423,6 +1423,9 @@ function start-kube-addons {
if [[ "${ENABLE_DEFAULT_STORAGE_CLASS:-}" == "true" ]]; then
setup-addon-manifests "addons" "storage-class/gce"
fi
if [[ "${NON_MASQUERADE_CIDR:-}" == "0.0.0.0/0" ]]; then
setup-addon-manifests "addons" "ip-masq-agent"
fi
# Place addon manager pod manifest.
cp "${src_dir}/kube-addon-manager.yaml" /etc/kubernetes/manifests