Skip to content

Commit

Permalink
feat(k3s): Change k3s installation to allow remote kubectl calls (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
alchen99 authored Jul 29, 2020
1 parent 2051573 commit b9880f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ARMORY_HALYARD_IMAGE="armory/halyard-armory:1.9.4"

install_k3s () {
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.17.7+k3s1" K3S_KUBECONFIG_MODE=644 sh -
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--tls-san $(cat ${BASE_DIR}/.hal/public_endpoint)" INSTALL_K3S_VERSION="v1.17.4+k3s1" K3S_KUBECONFIG_MODE=644 sh -
}

install_yq () {
Expand Down
6 changes: 3 additions & 3 deletions scripts/operator_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ print_help () {

install_k3s () {
# curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--no-deploy=traefik" K3S_KUBECONFIG_MODE=644 sh -
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.17.4+k3s1" K3S_KUBECONFIG_MODE=644 sh -
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--tls-san $(cat ${BASE_DIR}/.hal/public_endpoint)" INSTALL_K3S_VERSION="v1.17.4+k3s1" K3S_KUBECONFIG_MODE=644 sh -
}

install_yq () {
Expand Down Expand Up @@ -223,11 +223,11 @@ if [[ ${LINUX} -eq 1 ]]; then

sudo chown -R 1000 ${BASE_DIR}

detect_endpoint

install_k3s
install_yq

detect_endpoint

sudo env "PATH=$PATH" kubectl config set-context default --namespace spinnaker

else
Expand Down
6 changes: 3 additions & 3 deletions scripts/utils/external_service_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ done

for svc in $(cat ${BASE_DIR}/.hal/all_services); do
echo "Adding Minnaker reference to ${svc} to dev config..."
PORT=$(kubectl get svc spin-${svc} -ojsonpath='{.spec.ports[0].port}')
PORT=$(kubectl --context ${KUBERNETES_CONTEXT} -n ${NAMESPACE} get svc spin-${svc} -ojsonpath='{.spec.ports[0].port}')
yq w -i ${BASE_DIR}/.hal/spinnaker-local.yml services.${svc}.baseUrl http://${MINNAKER_IP}:${PORT}
echo "Configuring svc/spin-${svc} to type LoadBalancer"
touch ${BASE_DIR}/.hal/default/service-settings/${SVC}.yml
Expand All @@ -53,7 +53,7 @@ done
echo "Configuring Minnaker for these services:"
for svc in $(cat ${BASE_DIR}/.hal/external_services); do
echo "Adding external reference to ${svc} to Minnaker config..."
PORT=$(kubectl get svc spin-${svc} -ojsonpath='{.spec.ports[0].port}')
PORT=$(kubectl --context ${KUBERNETES_CONTEXT} -n ${NAMESPACE} get svc spin-${svc} -ojsonpath='{.spec.ports[0].port}')
yq w -i ${BASE_DIR}/.hal/default/profiles/spinnaker-local.yml services.${svc}.baseUrl http://${EXTERNAL_IP}:${PORT}
echo "Scaling Minnaker ${svc} to 0 instances..."
yq w -i ${BASE_DIR}/.hal/config deploymentConfigurations[0].deploymentEnvironment.customSizing.spin-${svc}.replicas 0
Expand Down Expand Up @@ -111,4 +111,4 @@ echo "--------------"
cat ${BASE_DIR}/.hal/spinnaker-local.yml
echo "--------------"

# TODO: change overridebaseurls so we can do http things
# TODO: change overridebaseurls so we can do http things

0 comments on commit b9880f8

Please sign in to comment.