generate-cert: allow for alternative paths

Instead of hard coding kube-cert and /srv/kubernetes allow these to be
overwritten by environment variables.  / is immutable on some systems
and so /srv is not a possible location to store data.
This commit is contained in:
Eric Paris 2015-06-10 12:50:14 -04:00
parent b90663924b
commit 6b9ef5b2d8
3 changed files with 6 additions and 5 deletions

View File

@ -20,8 +20,8 @@ set -o pipefail
cert_ip=$1
extra_sans=${2:-}
cert_dir=/srv/kubernetes
cert_group=kube-cert
cert_dir=${CERT_DIR:-/srv/kubernetes}
cert_group=${CERT_GROUP:-kube-cert}
mkdir -p "$cert_dir"

View File

@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
cert_dir=/srv/kubernetes
cert_group=kube-cert
cert_dir=${CERT_DIR:-/srv/kubernetes}
cert_group=${CERT_GROUP:-kube-cert}
mkdir -p "$cert_dir"

View File

@ -22,6 +22,7 @@ KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl}
ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-600}
SYSTEM_NAMESPACE=kube-system
token_dir=${TOKEN_DIR:-/srv/kubernetes}
function create-kubeconfig-secret() {
local -r token=$1
@ -174,7 +175,7 @@ while read line; do
# do not have DNS available will have to override the server.
create-kubeconfig-secret "${token}" "${username}" "https://kubernetes.default"
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
# are defined in a namespace other than default, we should still create the limits for the