Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 622c7ba

Browse files
authored
Merge pull request #292 from charlieegan3/encryption-config
Enable secrets and configMaps encryption in etcd rest on the apiserver
2 parents 67767e1 + f5bf849 commit 622c7ba

File tree

20 files changed

+977
-355
lines changed

20 files changed

+977
-355
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2222
| Vault | | `0.9.5` |
2323
| Kubernetes | `>= 1.7 && < 1.11` | `1.9.7` |
2424
| Calico | | `3.1.1` |
25-
| Vault Helper| | `0.9.7` |
25+
| Vault Helper| | `0.9.12` |
2626
| Etcd | | `3.2.17` |
2727

2828
## [0.3.0]: 0.3.0 - 2018-02-20

Gopkg.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ required = [
4848

4949
[[constraint]]
5050
name = "github.com/jetstack/vault-helper"
51-
version = "0.9.10"
51+
version = "0.9.12"
5252

5353
[[constraint]]
5454
name = "github.com/cenkalti/backoff"

puppet/modules/kubernetes/manifests/apiserver.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
$admission_control = undef,
99
$count = 1,
1010
$storage_backend = undef,
11+
Optional[String] $encryption_config_file = undef,
1112
$etcd_nodes = ['localhost'],
1213
$etcd_port = 2379,
1314
$etcd_events_port = undef,

puppet/modules/kubernetes/manifests/init.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
$_service_account_key_file = $service_account_key_file
106106
}
107107

108+
108109
if $cluster_dns == undef {
109110
$_sir_parts = $service_ip_range_network.split('\.')
110111
$_cluster_dns = "${_sir_parts[0]}.${_sir_parts[1]}.${_sir_parts[2]}.10"

puppet/modules/kubernetes/templates/kube-apiserver.service.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ ExecStart=<%= scope['kubernetes::_dest_dir'] %>/apiserver \
8282
<%- if scope['kubernetes::_service_account_key_file'] -%>
8383
--service-account-key-file=<%= scope['kubernetes::_service_account_key_file'] %> \
8484
<% end -%>
85+
<%- if @post_1_7 and @encryption_config_file -%>
86+
--experimental-encryption-provider-config=<%= @encryption_config_file %> \
87+
<% end -%>
8588
<%- if scope.function_versioncmp([scope['kubernetes::version'], '1.9.0']) >= 0 -%>
8689
--endpoint-reconciler-type=lease \
8790
<%- else -%>

puppet/modules/tarmak/manifests/master.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
uid => $::tarmak::kubernetes_uid,
3232
}
3333

34+
$encryption_config_file = "${::tarmak::kubernetes_config_dir}/encryption-config.yaml"
35+
vault_client::secret_service { 'kube-encryption-config-file':
36+
field => 'content',
37+
secret_path => "${::tarmak::cluster_name}/secrets/encryption-config",
38+
dest_path => $encryption_config_file,
39+
uid => $::tarmak::kubernetes_uid,
40+
}
41+
3442
$controller_manager_base_path = "${::tarmak::kubernetes_ssl_dir}/kube-controller-manager"
3543
vault_client::cert_service { 'kube-controller-manager':
3644
base_path => $controller_manager_base_path,
@@ -132,6 +140,7 @@
132140
requestheader_client_ca_file => $requestheader_client_ca_file,
133141
proxy_client_cert_file => $proxy_client_cert_file ,
134142
proxy_client_key_file => $proxy_client_key_file,
143+
encryption_config_file => $encryption_config_file,
135144
}
136145

137146
class { 'kubernetes::controller_manager':

puppet/modules/tarmak/spec/acceptance/single_node_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
kubernetes_version => '#{kubernetes_version}',
4141
kubernetes_authorization_mode => #{kubernetes_authorization_mode},
4242
}
43-
44-
4543
"
4644
end
4745

puppet/modules/tarmak/spec/spec_helper_acceptance.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
# install myself
3636
install_dev_puppet_module_on(host, :source => module_root, :module_name => 'tarmak', :target_module_path => $module_path)
37-
38-
3937
end
4038
end
4139
end

puppet/modules/vault_client/files/vault-add-hostname.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -ex
55
export VAULT_ADDR=http://127.0.0.1:8200
66
export VAULT_TOKEN=root-token-dev
77

8-
vault read -format=json test/pki/k8s/roles/kubelet | python -c "import socket, sys, json; v=json.load(sys.stdin); v=v['data']; k='allowed_domains'; d=v[k].split(','); d.append(socket.gethostname()); v[k] = ','.join(list(set(d))); print json.dumps(v)" | vault write test/pki/k8s/roles/kubelet -
8+
vault read -format=json test/pki/k8s/roles/kubelet | python -c "import socket, sys, json; v=json.load(sys.stdin); v=v['data']; k='allowed_domains'; d=v[k]; d.append(socket.gethostname()); v[k] = ','.join(list(set(d))); print json.dumps(v)" | vault write test/pki/k8s/roles/kubelet -

0 commit comments

Comments
 (0)