Skip to content

copy k3s kubeconfig to default location #11

copy k3s kubeconfig to default location

copy k3s kubeconfig to default location #11

Workflow file for this run

---
name: Validate Helm Charts
# Events that trigger workflows: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
push: # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened
# Set Workflow-level permissions: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: read
# Set Workflow-level environment variables
env:
CHARTS_ROOT: "./charts"
jobs:
validate-template:
strategy:
matrix:
chart: [demoapp-backend, demoapp-frontend]
value: [values.yaml]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
# Helm is pre-installed in GitHub-hosted runners: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#package-management
- name: Helm Template
run: |
cd "${{env.CHARTS_ROOT}}/${{ matrix.chart }}"
helm dependency update .
helm template . --values "${{ matrix.value }}"
validate-dry-run-k3s:
strategy:
matrix:
chart: [demoapp-backend, demoapp-frontend]
value: [values.yaml]
# k3s releases: https://github.com/k3s-io/k3s/releases
k3s_version: ['', v1.28.2+k3s1, v1.27.7+k3s1, v1.26.10+k3s1]
runs-on: ubuntu-latest
env:
K3S_KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- name: Setup k3s
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${{ matrix.k3s_version }} sh -
sudo cp ${{ env.K3S_KUBECONFIG }} ~/.kube/config
chown $USER ~/.kube/config
chmod 600 ~/.kube/config
# Kubectl is pre-installed in GitHub-hosted runners: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#tools
- name: Get Version and Nodes
run: |
ls -la ${{ env.KUBECONFIG }}
# kubectl version
# kubectl get nodes
# - name: Checkout repository
# uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
# - name: Dry-run k3s
# run: |
# cd "${{env.CHARTS_ROOT}}/${{ matrix.chart }}"
# helm dependency update .
# helm template . --values "${{ matrix.value }}"
helm-dry-run-kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
helm-deploy-k3s:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
helm-dry-run-openshift:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout