Commit Graph

110 Commits

Author SHA1 Message Date
Mike Wilson
b25805f01c Adding extra_sans option to load balancer to allow custom SAN entries on the certificate
Adding support for restarting nginx on the load balancer
Added better support for knowing when certificates are written. This helps the master restart the apiserver appropriately.
2017-11-01 11:56:58 -04:00
Konstantinos Tsakalozos
42702518a1 Address lint errors 2017-10-25 10:34:20 +03:00
Kubernetes Submit Queue
df9e32b219 Merge pull request #53820 from juju-solutions/feature/rbac
Automatic merge from submit-queue (batch tested with PRs 53820, 53971). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for RBAC support to Kubernetes via Juju

**What this PR does / why we need it**: This PR add RBAC to the Juju deployment of Kubernetes

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: 

**Special notes for your reviewer**:

**Release note**:

```Canonical Distribution of Kubernetes offers configurable RBAC 
```
2017-10-24 09:32:15 -07:00
Mike Wilson
16036c3fd4 Change config.changed to config.changed.extra_sans so we only try to update certificates when the SAN entries change 2017-10-20 10:38:26 -04:00
Mike Wilson
d0a88264d8 Fixing spacing issue 2017-10-19 19:39:09 -04:00
Mike Wilson
73e8af34af Adding config option to add additional SANs to the master's certificate.
Regenerate certificate if data on certificate changes. This includes IP address and SANs.
Restart API server after updating certificate.
2017-10-19 09:44:58 -04:00
Konstantinos Tsakalozos
9a28e9b125 Addressing review comments 2017-10-17 22:31:22 +03:00
Konstantinos Tsakalozos
95fec2dc3f Work on upgrade path 2017-10-11 17:13:19 +03:00
Konstantinos Tsakalozos
50354896b6 Fix trimmed files comming from leadership 2017-10-09 11:05:42 +03:00
Konstantinos Tsakalozos
b8a4fa6d81 Move ingress to kube-system. Rename enable-rbac to authorization-mode. 2017-10-09 11:05:42 +03:00
Konstantinos Tsakalozos
eb698629df Use the updated (RBAC enabled) cdk-addons 2017-10-09 11:04:47 +03:00
Konstantinos Tsakalozos
ca7f8973f7 RBAC work on PoC 2017-10-09 11:03:52 +03:00
Konstantinos Tsakalozos
90e15b4bea Fix oversized comment line, lint error 2017-09-25 16:33:19 +03:00
Jacek Nykis
d6f5acc41a Rebase runtime-config branch on top of master 2017-08-29 15:06:53 +01:00
Konstantinos Tsakalozos
61ed067e63 Removing push_api_data on kube-api.connected seems to be dead code 2017-08-23 17:23:24 +03:00
Rye Terrell
809a0abb31 set k8s master charm state to blocked if the services appear to be failing 2017-07-27 08:13:15 -05:00
Kubernetes Submit Queue
0af4306695 Merge pull request #49296 from juju-solutions/feature/report-failing-services
Automatic merge from submit-queue (batch tested with PRs 49420, 49296, 49299, 49371, 46514)

Update status to show failing services.

**What this PR does / why we need it**: Report on charm status any services that are not running.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/341

**Special notes for your reviewer**:

**Release note**:

```Report failing services in Juju deployed clusters.
```
2017-07-21 22:23:17 -07:00
Konstantinos Tsakalozos
53f00722e2 Do not try to restart services 2017-07-21 12:39:42 +03:00
Konstantinos Tsakalozos
685dff99ab Update status to show failing services. 2017-07-20 14:57:02 +03:00
Konstantinos Tsakalozos
d5a71eb2d1 Simplify master-worker relation missing message 2017-07-20 11:47:50 +03:00
Konstantinos Tsakalozos
280ea7f485 Set default CIDR to /16 2017-07-19 09:34:23 +03:00
Kubernetes Submit Queue
3823270b9e Merge pull request #48446 from Cynerva/gkk/stop-snaps
Automatic merge from submit-queue (batch tested with PRs 47043, 48448, 47515, 48446)

Fix charms leaving services running after remove-unit

**What this PR does / why we need it**:

This fixes a case where removed charm units can sometimes leave behind running services that interfere with the rest of the cluster.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix charms leaving services running after remove-unit
```
2017-07-04 09:12:57 -07:00
Kubernetes Submit Queue
e1d9ab205a Merge pull request #48440 from Cynerva/gkk/snap-upgrades-restart-services
Automatic merge from submit-queue (batch tested with PRs 48439, 48440, 48394)

Fix kubernetes charms not restarting services after snap upgrades

**What this PR does / why we need it**:

This fixes a problem where the Kubernetes charms don't restart services after upgrading snaps. This can cause certain fixes not to be picked up (for example https://github.com/juju-solutions/release/pull/10)

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed kubernetes charms not restarting services after snap upgrades
```
2017-07-03 13:05:28 -07:00
George Kraft
f0e08818d8 Fix charms leaving services running after unit removal 2017-07-03 14:55:07 -05:00
George Kraft
c21b305fe9 Fix kubernetes charms not restarting services after snap upgrades 2017-07-03 09:47:08 -05:00
Konstantinos Tsakalozos
e2571a853a Non leaders should overwrite any local copies of keys they have with what the leader has. 2017-07-03 17:45:43 +03:00
Konstantinos Tsakalozos
cd34d8f80d Ensure get_password is accessing a file that exists. 2017-06-30 20:24:35 +03:00
Kubernetes Submit Queue
d19773d855 Merge pull request #47835 from juju-solutions/feature/security
Automatic merge from submit-queue (batch tested with PRs 47850, 47835, 46197, 47250, 48284)

Securing the cluster created by Juju

**What this PR does / why we need it**: This PR secures the deployments done with Juju master. Works around certain security issues inherent to kubernetes (see for example dashboard access)

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```
Securing Juju kubernetes dashboard
```
2017-06-29 15:16:39 -07:00
Konstantinos Tsakalozos
0b01cd743b Improve security of Juju deployed clusters 2017-06-27 12:19:21 +03:00
Konstantinos Tsakalozos
b3a1115796 Add a failsafe for etcd not returning a connection string 2017-06-26 13:00:17 +03:00
George Kraft
02d0830594 Fix Juju kubernetes-master idle_status never being called 2017-06-16 14:48:31 -05:00
Kubernetes Submit Queue
e72c64b7e3 Merge pull request #46987 from Cynerva/gkk/rm-initializers-before-1.7
Automatic merge from submit-queue

Remove Initializers from admission-control in kubernetes-master charm for pre-1.7

**What this PR does / why we need it**:

This fixes a problem with the kubernetes-master charm where kube-apiserver never comes up:

```
failed to initialize admission: Unknown admission plugin: Initializers
```

The Initializers plugin does not exist before Kubernetes 1.7. The charm needs to support 1.6 as well.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #47062

**Special notes for your reviewer**:

This fixes a problem introduced by https://github.com/kubernetes/kubernetes/pull/36721

**Release note**:

```release-note
Remove Initializers from admission-control in kubernetes-master charm for pre-1.7
```
2017-06-08 09:00:57 -07:00
Charles Butler
678c4bc8d4 Fixes 47182
This adds additional state guardsof  the idle_status method, which will
prevent it from being run until a worker has joined the relationship.
Previous invocations may have some message artifacting, but will reach
eventual consistency once a worker has joined.

This prevents the polling loop from executing too soon, bloating the
installation time by bare-minimum an additional 10 minutes.
2017-06-08 09:25:58 -05:00
George Kraft
e52a888814 Remove initializers from juju admission-control for 1.6 and earlier 2017-06-05 13:40:35 -05:00
Clayton Coleman
4ce3907639
Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
Konstantinos Tsakalozos
40f918dc91 Fix lint errors in juju kubernetes master and e2e charms 2017-05-08 17:29:27 +03:00
Konstantinos Tsakalozos
7cf2b0b263 Remove offending code due to bad rebase 2017-05-03 18:29:51 +03:00
Kubernetes Submit Queue
a8e940041e Merge pull request #44959 from ktsakalozos/bug/change-config
Automatic merge from submit-queue

Retry calls we report config changes quickly.

**What this PR does / why we need it**: In Juju deployments of Kubernetes the status of the charms is updated when a status-update is triggered periodically. As a result changes in config variables may take up to 10 minutes to be reflected on the charms status. See bug below.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/263

**Special notes for your reviewer**:

**Release note**:

```
Kubernetes clusters deployed with Juju pick up config changes faster.
```
2017-04-30 02:37:32 -07:00
Konstantinos Tsakalozos
e99d606277 Merge branch 'master' into bug/juju-master 2017-04-28 18:19:55 +03:00
Konstantinos Tsakalozos
7c6547a145 Retry of pods availablity 6 times over a minute 2017-04-28 18:06:39 +03:00
Charles Butler
690be0fb82 Fixes #43461
The master-components started state triggers a daemon recycle. The guard
was to prevent the daemons from being cycled too often and interrupting
normal workflow. This additional state check is guarded against the etcd
connection string from changing, allowing the current behavior but
triggers a re-configure and recycle of the api-control plane when etcd
units are scaling up and down.
2017-04-26 14:39:03 -05:00
Konstantinos Tsakalozos
6d32bb001f Retry methods and set states so we immediately report config changes. 2017-04-26 19:04:18 +03:00
Konstantinos Tsakalozos
d228609dca Send dns details only after cdk-addons are configured 2017-04-26 10:35:27 +03:00
Tim Van Steenburgh
7b841fe77e Fix nagios checks. 2017-04-14 10:45:37 -05:00
George Kraft
d50cf1e499 Fix juju kubernetes-master starting services before TLS certs are saved
master: Fix start_master args
2017-04-14 10:45:31 -05:00
Rye Terrell
ca4afd8773 Update CDK charms to use snaps 2017-04-14 10:43:00 -05:00
Konstantinos Tsakalozos
12a5c3a2f3 Fixing bug: non-leaders should retry fetching auth keys 2017-03-27 16:59:43 +03:00
Konstantinos Tsakalozos
533d4bfd54 Fixes: 1. Get certs for a dead leader. 2. Append tokens. 2017-03-24 12:46:55 +02:00
Tim Van Steenburgh
c87ac5ef2e Enable gpu mode if gpu hardware detected.
layer-nvidia-cuda does the hardware detection and sets a state that the
worker can react to.

When gpu is available, worker updates config and restarts kubelet to
enable gpu mode. Worker then notifies master that it's in gpu mode via
the kube-control relation.

When master sees that a worker is in gpu mode, it updates to privileged
mode and restarts kube-apiserver.

The kube-control interface has subsumed the kube-dns interface
functionality.

An 'allow-privileged' config option has been added to both worker and
master charms. The gpu enablement respects the value of this option;
i.e., we can't enable gpu mode if the operator has set
allow-privileged="false".
2017-03-23 12:01:23 -04:00
Zihong Zheng
3acff7d3ef Update startup scripts for kube-dns ConfigMap and ServiceAccount 2017-03-09 11:10:23 -08:00
Kubernetes Submit Queue
5b8d600d72 Merge pull request #41919 from Cynerva/gkk/kubelet-auth
Automatic merge from submit-queue (batch tested with PRs 41919, 41149, 42350, 42351, 42285)

Juju: Disable anonymous auth on kubelet

**What this PR does / why we need it**:

This disables anonymous authentication on kubelet when deployed via Juju.

I've also adjusted a few other TLS options for kubelet and kube-apiserver. The end result is that:
1. kube-apiserver can now authenticate with kubelet
2. kube-apiserver now verifies the integrity of kubelet

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:

https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/219

**Special notes for your reviewer**:

This is dependent on PR #41251, where the tactics changes are being merged in separately.

Some useful pages from the documentation:
* [apiserver -> kubelet](https://kubernetes.io/docs/admin/master-node-communication/#apiserver---kubelet)
* [Kubelet authentication/authorization](https://kubernetes.io/docs/admin/kubelet-authentication-authorization/)

**Release note**:

```release-note
Juju: Disable anonymous auth on kubelet
```
2017-03-03 16:44:37 -08:00
George Kraft
27504d8aca Juju: Disable anonymous auth on kubelet
Adds TLS verification between kube-apiserver and kubelet in both directions
2017-02-27 09:02:24 -06:00
axino
83766d2894 add nrpe-external-master relation to kubernetes-master and kubernetes-worker
For now, the checks are very basic and only check if the systemd
services are running properly.
2017-02-26 10:37:34 -06:00
Charles Butler
4408b82a90 Fixes for #41019
This branch sync's the crypto keys, and flat-files used for auth with
all the masters when scaling the kubernetes-master units. This should
fix the mis-matched crypto keys seen when rebooting units after first
deploy.
2017-02-22 10:20:51 -06:00
Matt Bruzek
3b29b6a9ef Lint fixes for the master and worker Python code. 2017-02-16 14:01:30 -06:00
George Kraft
b0a9c00bbb improve status messages around KubeDNS 2017-01-30 10:09:10 -06:00
George Kraft
a371b1bc27 Add "Waiting for kube-system pods to start" status message 2017-01-30 09:05:29 -06:00
George Kraft
5c5fa43700 Remove "Kubernetes master services ready." status message
This message was occurring prematurely - the master is running,
but the charm still has work to do. e.g. deploy KubeDNS.
2017-01-30 09:05:29 -06:00
George Kraft
df48acb41d slightly clean up kubedns reactive step 2017-01-30 09:05:28 -06:00
Matt Bruzek
3fcf279cfb Splitting master/node services into separate charm layers
This branch includes a rollup series of commits from a fork of the
kubernetes repository pre 1.5 release because we didn't make the code freeze.
This additional effort has been fully tested and has results submit into
the gubernator to enhance confidence in this code quality vs. the single
layer, posing as both master/node.

To reference the gubernator results, please see:
https://k8s-gubernator.appspot.com/builds/canonical-kubernetes-tests/logs/kubernetes-gce-e2e-node/

Apologies in advance for the large commit, however we did not want to
submit without having successful upstream automated testing results.

This commit includes:

 - Support for CNI networking plugins
 - Support for durable storage provided by ceph
 - Building from upstream templates (read: kubedns - no more template
 drift!)
 - An e2e charm-layer to make running validation tests much simpler/repeatable
 - Changes to support the 1.5.x series of kubernetes

Additional note: We will be targeting -all- future work against upstream
so large pull requests of this magnitude will not occur again.
2017-01-24 09:42:25 -06:00