home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 00c92dfd2a10002777c46ee844c690dddf39f6c7
parent 74bc1005ec197e0d70bdfea09b9b578b79c23170
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Wed, 16 Oct 2019 10:54:48 +0200

profiles.kubernetes: add chos4 script

- Update devcluster configurations
- Auto login to it
- Bump the machineset

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Aassets/chos4.desktop | 6++++++
Mmodules/profiles/aliases.shell.nix | 1-
Mmodules/profiles/kubernetes.nix | 1+
Apkgs/scripts/bin/chos4 | 19+++++++++++++++++++
4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/assets/chos4.desktop b/assets/chos4.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=chos4 +Exec=chos4 +Type=Application +Terminal=true +Categories=System; diff --git a/modules/profiles/aliases.shell.nix b/modules/profiles/aliases.shell.nix @@ -12,6 +12,5 @@ t = ''exa --tree -L 2''; wget = ''wget -c''; map = ''xargs -n1''; - chos4 = ''curl -s chmouel.com/tmp/vincent.kubeadmin.password.gpg|gpg --decrypt > ~/.kube/kubeadmin.password.os4 && curl -s chmouel.com/tmp/vincent.webaccess.gpg|gpg --decrypt > ~/.kube/webaccess.os4 && curl -s chmouel.com/tmp/vincent.kubeconfig.gpg|gpg --decrypt > ~/.kube/config.os4 && export KUBECONFIG=~/.kube/config.os4''; m = ''m''; } diff --git a/modules/profiles/kubernetes.nix b/modules/profiles/kubernetes.nix @@ -33,6 +33,7 @@ in }; config = mkIf cfg.enable (mkMerge [ { + home.file.".local/share/applications/chos4.desktop".source = ../../assets/chos4.desktop; profiles.containers.enable = cfg.containers; home.packages = with pkgs; [ #cri-tools diff --git a/pkgs/scripts/bin/chos4 b/pkgs/scripts/bin/chos4 @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Update creds and link to the openshift4 devcluster + +set -e + +curl -s chmouel.com/tmp/vincent.kubeadmin.password.gpg|gpg --decrypt > ~/.kube/kubeadmin.password.os4 +curl -s chmouel.com/tmp/vincent.webaccess.gpg|gpg --decrypt > ~/.kube/webaccess.os4 +curl -s chmouel.com/tmp/vincent.kubeconfig.gpg|gpg --decrypt > ~/.kube/config.os4 && export KUBECONFIG=~/.kube/config.os4 + +export KUBECONFIG=~/.kube/config.os4 +oc login -u kubeadmin -p $(cat ~/.kube/kubeadmin.password.os4) + +echo ">>> scale machineset to 2" +for machineset in $(oc get machineset -n openshift-machine-api -o name); do + oc scale --replicas=2 ${machineset} -n openshift-machine-api +done + +echo ">>> your cluster is ready :)" +read