mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Merge pull request #9583 from eparis/make-cert-path
generate-cert: allow for alternative paths
This commit is contained in:
commit
e4fde6d2ca
@ -20,8 +20,8 @@ set -o pipefail
|
|||||||
|
|
||||||
cert_ip=$1
|
cert_ip=$1
|
||||||
extra_sans=${2:-}
|
extra_sans=${2:-}
|
||||||
cert_dir=/srv/kubernetes
|
cert_dir=${CERT_DIR:-/srv/kubernetes}
|
||||||
cert_group=kube-cert
|
cert_group=${CERT_GROUP:-kube-cert}
|
||||||
|
|
||||||
mkdir -p "$cert_dir"
|
mkdir -p "$cert_dir"
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ if [[ -n "${extra_sans}" ]]; then
|
|||||||
sans="${sans},${extra_sans}"
|
sans="${sans},${extra_sans}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tmpdir=$(mktemp -d --tmpdir kubernetes_cacert.XXXXXX)
|
tmpdir=$(mktemp -d -t kubernetes_cacert.XXXXXX)
|
||||||
trap 'rm -rf "${tmpdir}"' EXIT
|
trap 'rm -rf "${tmpdir}"' EXIT
|
||||||
cd "${tmpdir}"
|
cd "${tmpdir}"
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
cert_dir=/srv/kubernetes
|
cert_dir=${CERT_DIR:-/srv/kubernetes}
|
||||||
cert_group=kube-cert
|
cert_group=${CERT_GROUP:-kube-cert}
|
||||||
|
|
||||||
mkdir -p "$cert_dir"
|
mkdir -p "$cert_dir"
|
||||||
|
|
||||||
|
@ -44,7 +44,9 @@
|
|||||||
|
|
||||||
|
|
||||||
# global config
|
# global config
|
||||||
KUBECTL=${TEST_KUBECTL:-/usr/local/bin/kubectl} # substitute for tests
|
KUBECTL=${TEST_KUBECTL:-} # substitute for tests
|
||||||
|
KUBECTL=${KUBECTL:-${KUBECTL_BIN:-}}
|
||||||
|
KUBECTL=${KUBECTL:-/usr/local/bin/kubectl}
|
||||||
if [[ ! -x ${KUBECTL} ]]; then
|
if [[ ! -x ${KUBECTL} ]]; then
|
||||||
echo "ERROR: kubectl command (${KUBECTL}) not found or is not executable" 1>&2
|
echo "ERROR: kubectl command (${KUBECTL}) not found or is not executable" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -22,6 +22,7 @@ KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl}
|
|||||||
ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-600}
|
ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-600}
|
||||||
|
|
||||||
SYSTEM_NAMESPACE=kube-system
|
SYSTEM_NAMESPACE=kube-system
|
||||||
|
token_dir=${TOKEN_DIR:-/srv/kubernetes}
|
||||||
|
|
||||||
function create-kubeconfig-secret() {
|
function create-kubeconfig-secret() {
|
||||||
local -r token=$1
|
local -r token=$1
|
||||||
@ -174,7 +175,7 @@ while read line; do
|
|||||||
# do not have DNS available will have to override the server.
|
# do not have DNS available will have to override the server.
|
||||||
create-kubeconfig-secret "${token}" "${username}" "https://kubernetes.default"
|
create-kubeconfig-secret "${token}" "${username}" "https://kubernetes.default"
|
||||||
fi
|
fi
|
||||||
done < /srv/kubernetes/known_tokens.csv
|
done < ${token_dir}/known_tokens.csv
|
||||||
|
|
||||||
# Create admission_control objects if defined before any other addon services. If the limits
|
# Create admission_control objects if defined before any other addon services. If the limits
|
||||||
# are defined in a namespace other than default, we should still create the limits for the
|
# are defined in a namespace other than default, we should still create the limits for the
|
||||||
|
Loading…
Reference in New Issue
Block a user