Skip to content

Commit

Permalink
k3s wip
Browse files Browse the repository at this point in the history
  • Loading branch information
LiberatorUSA committed Aug 26, 2023
1 parent 367b6f3 commit 3c7283b
Show file tree
Hide file tree
Showing 11 changed files with 1,319 additions and 6 deletions.
15 changes: 10 additions & 5 deletions projects/k3s/dashboard/setup.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#!/bin/bash

# first delete the dashboard if one already exists
sudo k3s kubectl delete ns kubernetes-dashboard
sudo k3s kubectl delete clusterrolebinding kubernetes-dashboard
sudo k3s kubectl delete clusterrole kubernetes-dashboard
#sudo k3s kubectl delete ns kubernetes-dashboard
sudo k3s kubectl delete clusterrolebinding --ignore-not-found=true kubernetes-dashboard
sudo k3s kubectl delete clusterrole --ignore-not-found=true kubernetes-dashboard

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
#sudo k3s kubectl create -n kube-system -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml

sudo k3s kubectl apply --namespace=kubernetes-dashboard -f https://raw.githubusercontent.com/kubernetes/dashboard/v3.0.0-alpha0/charts/kubernetes-dashboard.yaml

# Deploy the admin-user configuration:
sudo k3s kubectl create -f ./dashboard.admin-user.yml -f ./dashboard.admin-user-role.yml
sudo k3s kubectl create --ignore-not-found=true -n kubernetes-dashboard -f ./dashboard.admin-user.yml -f ./dashboard.admin-user-role.yml

# Obtain the Bearer Token
sudo k3s kubectl -n kubernetes-dashboard describe secret admin-user-token | grep '^token'

# Port forward the dashboard such that its available from the node localhost
sudo k3s kubectl port-forward --namespace=kubernetes-dashboard service/kubernetes-dashboard-web 8000:8000 --address 0.0.0.0

# To access the Dashboard you must create a secure channel to your K3s cluster:
#sudo k3s kubectl proxy

Expand Down
3 changes: 3 additions & 0 deletions projects/k3s/github/github_runner_auth_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
authSecret:
github_token: <CopyYourOwnTokenFromGitHubHere!>
create: true
15 changes: 15 additions & 0 deletions projects/k3s/gitlab/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# create a namespace to host gitlabresources.
sudo kubectl create namespace gitlab

# add helm repo needed to get GitLab helm chart
sudo helm repo add gitlab http://charts.gitlab.io/ --kubeconfig /etc/rancher/k3s/k3s.yaml
sudo helm repo update --kubeconfig /etc/rancher/k3s/k3s.yaml

sudo helm uninstall my-gitlab --namespace gitlab --kubeconfig /etc/rancher/k3s/k3s.yaml --debug
sudo helm install my-gitlab gitlab/gitlab --version 5.10.2 --namespace gitlab --create-namespace --kubeconfig /etc/rancher/k3s/k3s.yaml --debug --values=./values.yaml
# --version 38.1.1

# Verify installation
sudo kubectl --namespace gitlab get all
Loading

0 comments on commit 3c7283b

Please sign in to comment.