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