add k8s
This commit is contained in:
parent
d50eba157f
commit
6cab51f957
2 changed files with 21 additions and 0 deletions
19
.github/workflows/deploy-postgres-dev.yml
vendored
19
.github/workflows/deploy-postgres-dev.yml
vendored
|
|
@ -43,6 +43,25 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install kubectl
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y curl ca-certificates
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
sudo install -m 0755 kubectl /usr/local/bin/kubectl
|
||||
|
||||
- name: Configure kubeconfig (in-cluster)
|
||||
run: |
|
||||
KUBE_HOST="https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT"
|
||||
SA_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
||||
CA_CERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
||||
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
|
||||
|
||||
kubectl config set-cluster microk8s --server="$KUBE_HOST" --certificate-authority="$CA_CERT"
|
||||
kubectl config set-credentials runner --token="$SA_TOKEN"
|
||||
kubectl config set-context runner-context --cluster=microk8s --user=runner --namespace="$NAMESPACE"
|
||||
kubectl config use-context runner-context
|
||||
|
||||
- name: Install Atlas
|
||||
run: curl -sSf https://atlasgo.sh | sh
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# This might be needed for runner permisison.
|
||||
# Unsure at the momnet
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue