-
Notifications
You must be signed in to change notification settings - Fork 30
82 lines (67 loc) · 2.34 KB
/
kind-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build Image
on: [pull_request]
env:
CLUSTER_NAME: argoproj-ossca
IMAGE_NAME: ossca:test
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Container Image
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:${{ github.actor }}"
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: ${{ env.IMAGE_NAME }}
load: true
- name: Set up environment (download Kubernetes dependencies)
run: |
TMP_DIR=$(mktemp -d)
# kubectl
curl -L https://dl.k8s.io/release/v1.30.2/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
# kind
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64
# Helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
# Install
sudo cp ${TMP_DIR}/kubectl /usr/local/bin/kubectl
sudo cp ${TMP_DIR}/kind /usr/local/bin/kind
sudo chmod +x /usr/local/bin/*
sudo rm -rf ${TMP_DIR}
sudo rm -rf ./get_helm.sh
kubectl version --client=true -o yaml
kind --version
helm version
- name: Create Simple Node Cluster
run: |
echo "kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: $CLUSTER_NAME
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 30080
- role: worker" >> config.yaml
kind create cluster --config ./config.yaml
- name: Image Upload to Kind
run: |
kind load docker-image ${{ env.IMAGE_NAME }} --name $CLUSTER_NAME
- name: Deployment Simple App
run: |
cd ${{ github.actor }}
helm install --wait --set image.name=${{ env.IMAGE_NAME }} ossca-test ./charts
- name: Check Deployment Success
run: |
docker ps
kubectl get pod --show-labels -o wide
kubectl get svc -o wide
curl -v localhost:30080/healthcheck