@@ -1781,23 +1781,22 @@ function setup-easyrsa {
1781
1781
# Note: This was heavily cribbed from make-ca-cert.sh
1782
1782
(set -x
1783
1783
cd " ${KUBE_TEMP} "
1784
- curl -L -O --connect-timeout 20 --retry 6 --retry-delay 2 https://dl.k8s.io/easy-rsa/easy-rsa.tar.gz
1785
- tar xzf easy-rsa.tar.gz
1786
- mkdir easy-rsa-master/kubelet
1787
- cp -r easy-rsa-master/easyrsa3/* easy-rsa-master/kubelet
1788
- mkdir easy-rsa-master/aggregator
1789
- cp -r easy-rsa-master/easyrsa3/* easy-rsa-master/aggregator
1790
- mkdir easy-rsa-master/cloud-pvl-admission
1791
- cp -r easy-rsa-master/easyrsa3/* easy-rsa-master/cloud-pvl-admission
1792
- mkdir easy-rsa-master/konnectivity-server
1793
- cp -r easy-rsa-master/easyrsa3/* easy-rsa-master/konnectivity-server
1794
- mkdir easy-rsa-master/konnectivity-agent
1795
- cp -r easy-rsa-master/easyrsa3/* easy-rsa-master/konnectivity-agent) & > " ${cert_create_debug_output} " || true
1796
- CERT_DIR=" ${KUBE_TEMP} /easy-rsa-master/easyrsa3"
1797
- AGGREGATOR_CERT_DIR=" ${KUBE_TEMP} /easy-rsa-master/aggregator"
1798
- CLOUD_PVL_ADMISSION_CERT_DIR=" ${KUBE_TEMP} /easy-rsa-master/cloud-pvl-admission"
1799
- KONNECTIVITY_SERVER_CERT_DIR=" ${KUBE_TEMP} /easy-rsa-master/konnectivity-server"
1800
- KONNECTIVITY_AGENT_CERT_DIR=" ${KUBE_TEMP} /easy-rsa-master/konnectivity-agent"
1784
+ curl -L -o easy-rsa.tar.gz --connect-timeout 20 --retry 6 --retry-delay 2 https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.7/EasyRSA-3.1.7.tgz
1785
+ mkdir -p easy-rsa && tar xzf easy-rsa.tar.gz -C easy-rsa --strip-components 1
1786
+ local -r files_to_copy=(easyrsa openssl-easyrsa.cnf x509-types vars.example)
1787
+ mkdir easy-rsa/aggregator
1788
+ cp -r easy-rsa/" ${files_to_copy[@]} " easy-rsa/aggregator
1789
+ mkdir easy-rsa/cloud-pvl-admission
1790
+ cp -r easy-rsa/" ${files_to_copy[@]} " easy-rsa/cloud-pvl-admission
1791
+ mkdir easy-rsa/konnectivity-server
1792
+ cp -r easy-rsa/" ${files_to_copy[@]} " easy-rsa/konnectivity-server
1793
+ mkdir easy-rsa/konnectivity-agent
1794
+ cp -r easy-rsa/" ${files_to_copy[@]} " easy-rsa/konnectivity-agent) & > " ${cert_create_debug_output} " || true
1795
+ CERT_DIR=" ${KUBE_TEMP} /easy-rsa"
1796
+ AGGREGATOR_CERT_DIR=" ${KUBE_TEMP} /easy-rsa/aggregator"
1797
+ CLOUD_PVL_ADMISSION_CERT_DIR=" ${KUBE_TEMP} /easy-rsa/cloud-pvl-admission"
1798
+ KONNECTIVITY_SERVER_CERT_DIR=" ${KUBE_TEMP} /easy-rsa/konnectivity-server"
1799
+ KONNECTIVITY_AGENT_CERT_DIR=" ${KUBE_TEMP} /easy-rsa/konnectivity-agent"
1801
1800
if [ ! -x " ${CERT_DIR} /easyrsa" ] || [ ! -x " ${AGGREGATOR_CERT_DIR} /easyrsa" ]; then
1802
1801
# TODO(roberthbailey,porridge): add better error handling here,
1803
1802
# see https://github.com/kubernetes/kubernetes/issues/55229
@@ -1830,8 +1829,8 @@ function generate-certs {
1830
1829
./easyrsa --batch " --req-cn=${PRIMARY_CN} @$( date +%s) " build-ca nopass
1831
1830
# SANS (expected to be) defined by caller
1832
1831
# shellcheck disable=SC2153
1833
- ./easyrsa --subject-alt-name=" ${SANS} " build-server-full " ${MASTER_NAME} " nopass
1834
- ./easyrsa build-client-full kube-apiserver nopass
1832
+ ./easyrsa --batch -- subject-alt-name=" ${SANS} " build-server-full " ${MASTER_NAME} " nopass
1833
+ ./easyrsa --batch build-client-full kube-apiserver nopass
1835
1834
1836
1835
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
1837
1836
@@ -1844,8 +1843,8 @@ function generate-certs {
1844
1843
rm -f " kubelet.csr"
1845
1844
1846
1845
# Make a superuser client cert with subject "O=system:masters, CN=kubecfg"
1847
- ./easyrsa --dn-mode=org \
1848
- --req-cn=kubecfg --req- org=system:masters \
1846
+ ./easyrsa --batch -- dn-mode=org \
1847
+ --req-org=system:masters \
1849
1848
--req-c= --req-st= --req-city= --req-email= --req-ou= \
1850
1849
build-client-full kubecfg nopass) & > " ${cert_create_debug_output} " || true
1851
1850
local output_file_missing=0
@@ -1891,12 +1890,12 @@ function generate-aggregator-certs {
1891
1890
local -r cert_create_debug_output=$( mktemp " ${KUBE_TEMP} /cert_create_debug_output.XXX" )
1892
1891
# Note: This was heavily cribbed from make-ca-cert.sh
1893
1892
(set -x
1894
- cd " ${KUBE_TEMP} /easy-rsa-master /aggregator"
1893
+ cd " ${KUBE_TEMP} /easy-rsa/aggregator"
1895
1894
./easyrsa init-pki
1896
1895
# this puts the cert into pki/ca.crt and the key into pki/private/ca.key
1897
1896
./easyrsa --batch " --req-cn=${AGGREGATOR_PRIMARY_CN} @$( date +%s) " build-ca nopass
1898
- ./easyrsa --subject-alt-name=" ${AGGREGATOR_SANS} " build-server-full " ${AGGREGATOR_MASTER_NAME} " nopass
1899
- ./easyrsa build-client-full aggregator-apiserver nopass
1897
+ ./easyrsa --batch -- subject-alt-name=" ${AGGREGATOR_SANS} " build-server-full " ${AGGREGATOR_MASTER_NAME} " nopass
1898
+ ./easyrsa --batch build-client-full aggregator-apiserver nopass
1900
1899
1901
1900
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
1902
1901
@@ -1909,8 +1908,8 @@ function generate-aggregator-certs {
1909
1908
rm -f " proxy-client.csr"
1910
1909
1911
1910
# Make a superuser client cert with subject "O=system:masters, CN=kubecfg"
1912
- ./easyrsa --dn-mode=org \
1913
- --req-cn=proxy-clientcfg --req- org=system:aggregator \
1911
+ ./easyrsa --batch -- dn-mode=org \
1912
+ --req-org=system:aggregator \
1914
1913
--req-c= --req-st= --req-city= --req-email= --req-ou= \
1915
1914
build-client-full proxy-clientcfg nopass) & > " ${cert_create_debug_output} " || true
1916
1915
local output_file_missing=0
@@ -1952,12 +1951,12 @@ function generate-konnectivity-server-certs {
1952
1951
# Note: This was heavily cribbed from make-ca-cert.sh
1953
1952
(set -x
1954
1953
# Make the client <-> konnectivity server side certificates.
1955
- cd " ${KUBE_TEMP} /easy-rsa-master /konnectivity-server"
1954
+ cd " ${KUBE_TEMP} /easy-rsa/konnectivity-server"
1956
1955
./easyrsa init-pki
1957
1956
# this puts the cert into pki/ca.crt and the key into pki/private/ca.key
1958
1957
./easyrsa --batch " --req-cn=${KONNECTIVITY_SERVER_PRIMARY_CN} @$( date +%s) " build-ca nopass
1959
- ./easyrsa --subject-alt-name=" IP:127.0.0.1,${KONNECTIVITY_SERVER_SANS} " build-server-full server nopass
1960
- ./easyrsa build-client-full client nopass
1958
+ ./easyrsa --batch -- subject-alt-name=" IP:127.0.0.1,${KONNECTIVITY_SERVER_SANS} " build-server-full server nopass
1959
+ ./easyrsa --batch build-client-full client nopass
1961
1960
1962
1961
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
1963
1962
@@ -1968,12 +1967,12 @@ function generate-konnectivity-server-certs {
1968
1967
rm -f " konnectivity-server.csr"
1969
1968
1970
1969
# Make the agent <-> konnectivity server side certificates.
1971
- cd " ${KUBE_TEMP} /easy-rsa-master /konnectivity-agent"
1970
+ cd " ${KUBE_TEMP} /easy-rsa/konnectivity-agent"
1972
1971
./easyrsa init-pki
1973
1972
# this puts the cert into pki/ca.crt and the key into pki/private/ca.key
1974
1973
./easyrsa --batch " --req-cn=${KONNECTIVITY_SERVER_PRIMARY_CN} @$( date +%s) " build-ca nopass
1975
- ./easyrsa --subject-alt-name=" ${KONNECTIVITY_SERVER_SANS} " build-server-full server nopass
1976
- ./easyrsa build-client-full client nopass
1974
+ ./easyrsa --batch -- subject-alt-name=" ${KONNECTIVITY_SERVER_SANS} " build-server-full server nopass
1975
+ ./easyrsa --batch build-client-full client nopass
1977
1976
1978
1977
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
1979
1978
@@ -2030,12 +2029,12 @@ function generate-cloud-pvl-admission-certs {
2030
2029
# Note: This was heavily cribbed from make-ca-cert.sh
2031
2030
(set -x
2032
2031
# Make the client <-> cloud-pvl-admission server side certificates.
2033
- cd " ${KUBE_TEMP} /easy-rsa-master /cloud-pvl-admission"
2032
+ cd " ${KUBE_TEMP} /easy-rsa/cloud-pvl-admission"
2034
2033
./easyrsa init-pki
2035
2034
# this puts the cert into pki/ca.crt and the key into pki/private/ca.key
2036
2035
./easyrsa --batch " --req-cn=${CLOUD_PVL_ADMISSION_PRIMARY_CN} @$( date +%s) " build-ca nopass
2037
- ./easyrsa --subject-alt-name=" IP:127.0.0.1,${CLOUD_PVL_ADMISSION_SANS} " build-server-full server nopass
2038
- ./easyrsa build-client-full client nopass
2036
+ ./easyrsa --batch -- subject-alt-name=" IP:127.0.0.1,${CLOUD_PVL_ADMISSION_SANS} " build-server-full server nopass
2037
+ ./easyrsa --batch build-client-full client nopass
2039
2038
2040
2039
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
2041
2040
@@ -2046,12 +2045,12 @@ function generate-cloud-pvl-admission-certs {
2046
2045
rm -f " cloud-pvl-admission.csr"
2047
2046
2048
2047
# Make the cloud-pvl-admission server side certificates.
2049
- cd " ${KUBE_TEMP} /easy-rsa-master /cloud-pvl-admission"
2048
+ cd " ${KUBE_TEMP} /easy-rsa/cloud-pvl-admission"
2050
2049
./easyrsa init-pki
2051
2050
# this puts the cert into pki/ca.crt and the key into pki/private/ca.key
2052
2051
./easyrsa --batch " --req-cn=${CLOUD_PVL_ADMISSION_PRIMARY_CN} @$( date +%s) " build-ca nopass
2053
- ./easyrsa --subject-alt-name=" ${CLOUD_PVL_ADMISSION_SANS} " build-server-full server nopass
2054
- ./easyrsa build-client-full client nopass
2052
+ ./easyrsa --batch -- subject-alt-name=" ${CLOUD_PVL_ADMISSION_SANS} " build-server-full server nopass
2053
+ ./easyrsa --batch build-client-full client nopass
2055
2054
2056
2055
kube::util::ensure-cfssl " ${KUBE_TEMP} /cfssl"
2057
2056
0 commit comments