Commit Graph

225 Commits (ef7b7ebd9cbf6e1c99ea2cbaa7b5de05b709e35e)

Author SHA1 Message Date
Ananth Suryanarayana d50d7763da Add opencontrail networking provisioning support in kubernetes salt based provisioning
OpenContrail is an open-source based networking software which provides virtualization support for the cloud.

This change-set adds ability to install and provision opencontrail software for networking in kubernetes based cloud environment.

There are basically 3 components

o kube-network-manager -- plugin between contrail components and kubernets components
o provision_master.sh -- OpenContrail software installer and provisioner in master node
o provision_minion.sh -- OpenContrail software installer and provisioner in minion node(s)

These are driven via salt configuration files

One can provision opencontrail by just setting "export NETWORK_PROVIDER=opencontrail"
Optionally, OPENCONTRAIL_TAG, and OPENCONTRAIL_KUBERNETES_TAG can be used to
specify opencontrail and contrail-kubernetes software versions to install and provision.

Public-IP Subnet provided by contrail can be configured via OPENCONTRAIL_PUBLIC_SUBNET
environment variable

At this moment, plan is to add support for aws, gce and vagrant based platforms

For more information on contrail-kubernetes, please visit https://github.com/juniper/contrail-kubernetes For more information on opencontrail, please visit http://www.opencontrail.org
2015-10-03 08:03:02 -07:00
nikhiljindal ed5d24ed52 Allow enabling deployment controller on GCE and GKE 2015-09-24 11:37:16 -07:00
Jerzy Szczepkowski 5be8817315 Turning on pod autoscaler on GCE.
Implemented optional turning on of pod autoscaler in kube-up script for GCE.
2015-09-11 12:03:41 +02:00
Jeff Lowdermilk 08442974bb Revert "Turning on pod autoscaler on GCE." 2015-09-10 11:46:37 -07:00
Jerzy Szczepkowski b41862b670 Turning on pod autoscaler on GCE.
Implemented optional turning on of pod autoscaler in kube-up script for GCE.
2015-09-10 16:10:01 +02:00
Isaac Hollander McCreery 219a1fae62 Second attempt at GCE tokens behavior to new format 2015-09-04 08:36:55 -07:00
Piotr Szczesniak b813ebadee Revert "GCE tokens behavior to new format" 2015-09-04 10:26:19 +02:00
Isaac Hollander McCreery d3398e2aed GCE tokens behavior to new format 2015-09-02 14:13:51 -07:00
Muhammed Uluyol 82638f8b29 Add conversion function from GCE storage units to kubernetes units. 2015-08-20 18:44:12 -07:00
Muhammed Uluyol 14b554cef6 Use a persistent volume for the docker registry. 2015-08-20 18:44:11 -07:00
Muhammed Uluyol 7129d477d3 Launch a cluster-local registry.
This registry can be accessed through proxies that run on each node
listening on port 5000. We send the proxy images to the nodes directly
to avoid requests that hit the network during cluster launch. For now,
we continue to pull the registry itself over the network, especially
given its large size (we should be able to dramatically shrink the
image). On GCE we create a PD and use that for storage, otherwise we
use an emptyDir. The registry is not enabled outside of GCE. All
communication is currently plain HTTP. In order to use SSL, we will
need to be able to request a certificate/key from the apiserver signed
by the apiserver's CA cert.
2015-08-20 18:44:05 -07:00
Robert Bailey 8df33bc1a7 Register the kubelet on the master node with an apiserver. This option is
separated from the apiserver running locally on the master node so that it
can be optionally enabled or disabled as needed.

Also, fix the healthchecking configuration for the master components, which
was previously only working by coincidence:

If a kubelet doesn't register with a master, it never bothers to figure out
what its local address is. In which case it ends up constructing a URL like
http://:8080/healthz for the http probe. This happens to work on the master
because all of the pods are using host networking and explicitly binding to
127.0.0.1. Once the kubelet is registered with the master and it determines
the local node address, it tries to healthcheck on an address where the pod
isn't listening and the kubelet periodically restarts each master component
when the liveness probe fails.
2015-08-06 13:39:32 -07:00
gmarek 5bb7eec5ab Use salt pillars to pass test arguments during cluster creation. 2015-07-31 09:32:01 +02:00
Piotr Szczesniak f48543aba5 Made enabling Kube UI configurable 2015-07-27 08:23:04 +02:00
Robert Bailey 728b337e9c Refactor the functions that generate auth for the kubelet and kubeproxy
and remove the insecure configuration now that GKE has plumbed through
certificates.
2015-07-17 16:13:01 -07:00
Eric Paris 58df58f3d7 Remove unused enable_node_monitoring option
Back in 1a7f7245e7 we dropped the one
place this was used, but left all of the variable and definitions and
garbage around cluster/
2015-06-25 20:57:56 -04:00
Tim Hockin 280f99afd9 EOL our registry caching mirror
Docker's v1 registry has gotten slower and slower, and they have no
interest in fixing it.  Using a mirror forces v1 mode.  Measurements
show that v1 with our mirror is slower than v2 with docker's registry in
just about all metrics.
2015-06-24 09:56:59 -07:00
Satnam Singh 55f791ca15 Merge pull request #10050 from zmerlynn/checkbinaries
Validate binaries downloaded from GCS:
2015-06-18 14:14:56 -07:00
Zach Loafman d8da39ecd0 Validate binaries downloaded from GCS:
* Set SHA1 for Kubernetes server binary and Salt tar in kube-env.
* Check SHA1 in configure-vm.sh. If the env variable isn't available,
download the SHA1 from GCS and double check that.
* Fixes a bug in the devel path where we were actually uploading the
wrong sha1 to the bucket.

Fixes #10021
2015-06-18 13:37:05 -07:00
CJ Cullen abf1e768dc Pass through an explicit PROXY_SSH_USER.
Use user@user instead of user@hostname in case hostname is too long.
2015-06-18 10:35:02 -07:00
CJ Cullen 04cd9b3c75 Make sshproxy use a hostmount on master PD (don't spam sshKeys on upgrade/reboot).
Add comment describing what SSHTunnelList.Close() does.
Simplify util.FileExists.
2015-06-05 15:03:03 -07:00
CJ Cullen cb317604ab Some refactoring. Only selectively use ssh proxy.
Add NetworkName to gce.Config.
Add locking to uses of master.tunnels.
2015-06-05 14:55:16 -07:00
Prashanth Balasubramanian f7c0f1c1e3 Set min-request-timeout in test clusters 2015-06-03 08:46:28 -07:00
Brian Grant 3da686fea5 Merge pull request #8894 from cjcullen/kmaster2
Add an explicit variable to indicate whether an instance is master or not
2015-06-02 20:37:43 -07:00
CJ Cullen dcf5b16cea Add an explicit KUBERNETES_MASTER variable to the kube-env. 2015-06-02 17:17:02 -07:00
CJ Cullen 934c553c04 Clarify description/usage of --advertise-address, Master.PublicAddress 2015-06-02 15:23:32 -07:00
CJ Cullen 085a48a70e Add an advertise-address flag. This allows the address that the apiserver binds
to (possibly 0.0.0.0) to be different than the address on which members of the cluster
can reach the apiserver (possibly not a local interface).
2015-06-02 14:33:15 -07:00
Filip Grzadkowski caafd28245 Retry downloading binary tars in case of unpack failure 2015-06-02 14:59:15 +02:00
Wojciech Tyczynski 4fc38849ea Retry downloading tars in case of unpack failure 2015-05-29 13:06:24 +02:00
Tim Hockin ac3cc3c518 Rename PORTAL_NET all over 2015-05-28 16:10:44 -07:00
Prashanth B 1f0b4c5e2a Merge pull request #8232 from zmerlynn/i8196
Ensure basic DNS functionality before doing real work in configure-vm.sh
2015-05-15 10:19:35 -07:00
Robert Bailey 9edc359de7 Fix an unbound variable error when CA_CERT isn't set. 2015-05-14 15:42:16 -07:00
Robert Bailey 9ab41db7ea Static cert distribution for GCE.
To make cert validation work, no longer use the
fqdn for the master name on the node VMs.
2015-05-14 11:59:13 -07:00
Zach Loafman 06c22c699a Ensure basic DNS functionality before doing real work in configure-vm.sh
Fixes #8196. Maybe. If my theory is correct on how we got there. Also
changes the inference of master to be based on the master name, not
the node instance prefix. That way if we somehow have a bogus
hostname, the master will configure itself as a node, the whole
cluster fails, and it's a ton more obvious.
2015-05-13 19:12:53 -07:00
Dawn Chen 309a157665 Merge pull request #7984 from cjcullen/kubelet
Kubelet configure cbr0 instead of configure-vm.sh
2015-05-13 17:32:52 -07:00
Robert Bailey c47b9178b4 Replace the auth config file with a kubeconfig file when
starting the kubelet on GCE.
2015-05-13 01:03:28 -07:00
CJ Cullen 5e3d2b9138 Kubelet configure cbr0 instead of configure-vm.sh 2015-05-12 23:00:12 -07:00
Max Forbes 76c89db5a8 Master vs node salt auth refactor in configure-vm.sh 2015-05-12 13:26:11 -07:00
CJ Cullen fbd125e4e2 Remove restriction that cluster-cidr be a class-b 2015-05-06 15:01:13 -07:00
Jerzy Szczepkowski 58962100db Merge pull request #7827 from zmerlynn/safe_format_cleanup
Clean up safe_format_and_mount spam in the startup logs
2015-05-06 10:50:32 +02:00
Zach Loafman 399f7dee43 Clean up safe_format_and_mount spam in the startup logs
Totally minor cleanup, but I'm tired of seeing it's spam in the
startup logs.
2015-05-05 21:23:57 -07:00
Jerzy Szczepkowski e967ffd522 Added flag to set cluster class B network address for pods, add flag to disable allocation CIDRs for Pods. Fixed synchornization bug in NodeController registerNodes(). 2015-05-05 16:10:43 -07:00
Robert Bailey 9718d667a7 Merge pull request #7744 from zmerlynn/allow_builtin_salt
Skip SaltStack install if it's already installed
2015-05-04 16:32:56 -07:00
Zach Loafman dd7f3f7df7 Skip SaltStack install if it's already installed
Next ContainerVM image will have SaltStack in it. Also be a little
less persnickety if it's found running. This isn't the case, but we
don't have to be aggressive.
2015-05-04 16:12:53 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Robert Bailey 8206aa9eac Salt configuration to add basic auth to GCE. 2015-04-28 14:07:54 -07:00
Eric Tune 9044177bb6 Generate a token for kube-proxy.
Tested on GCE.
Includes untested modifications for AWS and Vagrant.
No changes for any other distros.
Probably will work on other up-to-date providers
but beware.  Symptom would be that service proxying
stops working.

 1. Generates a token kube-proxy in AWS, GCE, and Vagrant setup scripts.
 1. Distributes the token via salt-overlay, and salt to /var/lib/kube-proxy/kubeconfig
 1. Changes kube-proxy args:
   - use the --kubeconfig argument
   - changes --master argument from http://MASTER:7080 to https://MASTER
     - http -> https
     - explicit port 7080 -> implied 443

Possible ways this might break other distros:

Mitigation: there is an default empty kubeconfig file.
If the distro does not populate the salt-overlay, then
it should get the empty, which parses to an empty
object, which, combined with the --master argument,
should still work.

Mitigation:
  - azure: Special case to use 7080 in
  - rackspace: way out of date, so don't care.
  - vsphere: way out of date, so don't care.
  - other distros: not using salt.
2015-04-27 08:59:57 -07:00
Eric Tune e8a83b23d1 Pass KUBELET_TOKEN in kube-env metadata.
ensure-kube-token is not needed anymore because
the token passed in kube-env.

In the up case it is set, in the push case it is an empty string
but not used.

Allow unset KUBELET_TOKEN (for push case).

Fix comment.
2015-04-23 15:21:27 -07:00
Robert Bailey dc45f7f9e6 Remove nginx and replace basic auth with bearer token auth for GCE.
- Configure the apiserver to listen securely on 443 instead of 6443.
 - Configure the kubelet to connect to 443 instead of 6443.
 - Update documentation to refer to bearer tokens instead of basic auth.
2015-04-22 11:11:20 -07:00
Zach Loafman 86468cd29d Revert "Added kube-proxy token." 2015-04-22 10:55:08 -07:00
Eric Tune 2ca8a9d15d Added kube-proxy token.
Generates the new token on AWS, GCE, Vagrant.
Renames instance metadata from "kube-token" to "kubelet-token".
(Is this okay for GKE?)

Having separate tokens for kubelet and kube-proxy permits
using principle of least privilege, makes it easy to
rate limit the clients separately, allows annotation
of apiserver logs with the client identity at a finer grain
than just source-ip.
2015-04-21 09:21:31 -07:00
Zach Loafman bcb63642b8 Make reboots work on GCE/GKE
* Fixes an issue where salt-minion would actually come up after reboot
(upstart is horrible obnoxious)
* Caches .deb downloads
* Handles PD remount on reboot correctly
* Notes a future optimization

Fixes #5666
2015-04-17 12:12:00 -07:00
Zach Loafman 9e5fd874cc First hack at upgrade script for GCE:
Address #6075: Shoot the master VM while saving the master-pd. This
takes a couple of minor changes to configure-vm.sh, some of which also
would be necessary for reboot. In particular, I changed it so that the
kube-token instance metadata is no longer required after inception;
instead, we mount the master-pd and see if we've already created the
known tokens file before blocking on the instance metadata.

Also partially addresses #6099 in bash by refactoring the kube-push
path.
2015-04-05 11:42:34 -07:00
Eric Tune 59daeabaee Make secrets at cluster startup.
These secrets will be used in subsequent PRs by:
scheduler, controller-manager, monitoring services,
logging services, and skydns.

Each of these services will then be able to stop using kubernetes-ro
or host networking.
2015-04-02 15:58:45 -07:00
CJ Cullen 5e6e67ba59 Add an alternative TokenSource to the GCE CloudProvider. 2015-04-01 17:52:30 -07:00
Alex Robinson 4f9b1c486f Don't ever give up on retrying downloads in the GCE download-or-bust function. 2015-04-02 00:40:19 +00:00
Zach Loafman 6c219885e0 s/apiservers/api_servers/ in Salt
It looks like api_servers finally won this battle. Kill off the
last remaining places passing it, but allow the kubelet Salt to
accept apiservers for a period of time.

(This was bothering my OCD.)
2015-03-31 12:29:46 -07:00
Victor Marmol 0c75f26a74 Merge pull request #6148 from zmerlynn/brctl_complaint
Fix "brctl: invalid command" message appearing in startup logs
2015-03-30 08:01:30 -07:00
Zach Loafman b3636bba34 Fix "brctl: invalid command" message appearing in startup logs
We were actually failing to call brctl in configure-vm.sh. I finally
tracked it down to the attempt to delete the docker0 bridge. This
particular package was getting installed later by Salt anyways, so
all this PR is doing is moving the package install up from Salt to
bash.

Also adds some minor logging.
2015-03-29 18:30:33 -07:00
Zach Loafman 708553f0bb GCE node salt: Use the master FQDN, not the master IP
This will allow us to upgrade the master by full re-provision, without
even bothering to reserve the IP.
2015-03-28 13:44:45 -07:00
Zach Loafman 68ccb97907 Remove the --machines SaltStack configuration on GCE
Per https://github.com/GoogleCloudPlatform/kubernetes/issues/6072#issuecomment-87074456, this is no longer necessary.
We now no longer need a static node list. Woo!
2015-03-27 14:44:19 -07:00
Max Forbes ddb0a70481 Fix tiny salt logging line. 2015-03-26 14:37:51 -07:00
Zach Loafman ed567736ea Retry apt operations to death
Nodes are probably broken if update or install fails. Don't proceed
if we can't get past these. Also, instead of ignoring the error off
dpkg, use --force depends, which changes the errors to be kinder
warnings for anyone looking through the logs.
2015-03-24 16:11:40 -07:00
Zach Loafman 57cd8165b0 Ensure salt-minion never starts by setting invoke-rc.d policy using
the /usr/sbin/policy-rc.d script and returning 101, per
https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt,
but only for the window while we're installing Salt.

This is a much more fool-proof method than what I was attempting
before. I hunted for how to do this before and clearly failed at my
Google-fu.

Fixes #5621
2015-03-18 16:15:24 -07:00
Satnam Singh dfb9f2aa17 Revert "Revert "Actually update binaries during kube-push"" 2015-03-12 18:04:36 -07:00
Satnam Singh bb2c3037e0 Revert "Actually update binaries during kube-push" 2015-03-12 17:09:50 -07:00
Satnam Singh c3951d7cf6 Merge pull request #5415 from zmerlynn/fix_binary_push
Actually update binaries during kube-push
2015-03-12 16:51:28 -07:00
Zach Loafman b02188b7d8 Actually update binaries during kube-push
This was a dumb mistake during a re-factor of configure-vm. I tested
this early, re-factored the tail of this file, spot checked kube-push
and failed to test kube-push properly. My bad.

Fixes #5361. Fixes #5408.
2015-03-12 16:44:32 -07:00
Zach Loafman 9fc5262c14 Infer KUBERNETES_MASTER from hostname rather than requiring it to be explicit
This allows GKE to have the same YAML on both the master and nodes
2015-03-12 11:51:21 -07:00
Satnam Singh e16bcceceb Merge pull request #5390 from brendandburns/shell_sucks
Configure docker on the master like we do on workers.
2015-03-12 11:42:03 -07:00
Brendan Burns 17ff8fb421 Configure docker on the master like we do on workers. 2015-03-12 10:37:30 -07:00
Zach Loafman d4f06cea9f Don't always run mount-master-pd 2015-03-11 19:58:44 -07:00
derekwaynecarr 468bf1da75 Enable common set of admission controllers across salt providers 2015-03-11 11:06:00 -04:00
Zach Loafman b31b633f85 One additional cleanup: Send only the master name, rather the internal
IP address. The configure-vm script can resolve this relatively easily
on the node. This is less painful for GKE, which creates all the
resources in parallel.
2015-03-10 09:04:29 -07:00
Zach Loafman 120dba474e Change GCE to use standalone Saltstack config:
Change provisioning to pass all variables to both master and node. Run
Salt in a masterless setup on all nodes ala
http://docs.saltstack.com/en/latest/topics/tutorials/quickstart.html,
which involves ensuring Salt daemon is NOT running after install. Kill
Salt master install. And fix push to actually work in this new flow.

As part of this, the GCE Salt config no longer has access to the Salt
mine, which is primarily obnoxious for two reasons: - The minions
can't use Salt to see the master: this is easily fixed by static
config. - The master can't see the list of all the minions: this is
fixed temporarily by static config in util.sh, but later, by other
means (see
https://github.com/GoogleCloudPlatform/kubernetes/issues/156, which
should eventually remove this direction).

As part of it, flatten all of cluster/gce/templates/* into
configure-vm.sh, using a single, separate piece of YAML to drive the
environment variables, rather than constantly rewriting the startup
script.
2015-03-10 09:04:29 -07:00