-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys: Configure the aggregation layer (#42)
https://kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/ Using https://github.com/Azure/acs-engine/pull/1406/files for reference Required by: https://github.com/kubernetes-incubator/metrics-server
- Loading branch information
1 parent
4562863
commit f5bd8bf
Showing
12 changed files
with
139 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
_ca_args="/etc/cfssl/proxy-ca-csr.json" | ||
_args="/etc/cfssl/proxy-csr.json" | ||
|
||
if [ ! -f "${_ca_args}" ]; then | ||
echo "${_ca_args} not found" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f "${_args}" ]; then | ||
echo "${_args} not found" | ||
exit 1 | ||
fi | ||
|
||
[ -f proxy-ca-key.pem ] && _ca_args="-ca-key=proxy-ca-key.pem ${_ca_args}" | ||
|
||
[ -f proxy-ca-key.pem ] && [ -f proxy-ca.pem ] \ | ||
&& (( "$(date +%s)" < "$(date -d "$(/opt/bin/cfssl certinfo -cert=/var/lib/cfssl/proxy-ca.pem | jq -r '.not_after')" +%s)" - 7 * 24 * 3600 )) \ | ||
|| /opt/bin/cfssl gencert -initca ${_ca_args} | /opt/bin/cfssljson -bare proxy-ca - | ||
|
||
[ -f proxy-key.pem ] && [ -f proxy.pem ] \ | ||
&& (( "$(date +%s)" < "$(date -d "$(/opt/bin/cfssl certinfo -cert=/var/lib/cfssl/proxy.pem | jq -r '.not_after')" +%s)" - 7 * 24 * 3600 )) \ | ||
|| /opt/bin/cfssl gencert -ca proxy-ca.pem -ca-key proxy-ca-key.pem ${_args} | /opt/bin/cfssljson -bare proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
|
||
set -o errexit | ||
|
||
key() { | ||
local key=$$1 | ||
/usr/bin/curl -Ls -o $${key} \ | ||
-H 'Authorization: Basic ${auth}' \ | ||
http://$(jq -r '.remotes.server | split(":")[0]' /etc/cfssl/config.json):8889/$${key} | ||
set +e | ||
/usr/bin/openssl ec -in ${path}/$${key} -noout | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to get $${key} from cfssl server"; | ||
exit 1; | ||
fi | ||
set -e | ||
/usr/bin/chmod 0600 $${key} | ||
} | ||
|
||
cert () { | ||
local cert=$$1 | ||
/usr/bin/curl -Ls -o $${cert} \ | ||
-H 'Authorization: Basic ${auth}' \ | ||
http://$(jq -r '.remotes.server | split(":")[0]' /etc/cfssl/config.json):8889/$${cert} | ||
set +e | ||
/opt/bin/cfssl certinfo -cert $${cert} | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to get $${cert} from cfssl server"; | ||
exit 1; | ||
fi | ||
set -e | ||
/usr/bin/chmod 0600 $${cert} | ||
} | ||
|
||
mkdir -p ${path} | ||
cd ${path} | ||
|
||
key signing-key.pem | ||
cert proxy-ca.pem | ||
cert proxy.pem | ||
key proxy-key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"CN": "proxyClientCA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"key": { | ||
"algo": "ecdsa", | ||
"size": 256 | ||
}, | ||
"CN": "aggregator", | ||
"names": [ | ||
{ | ||
"O": "system:masters" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters