mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
add k8s yaml and add steps in workflow
This commit is contained in:
parent
145c3b12ec
commit
c6d328c8d1
2 changed files with 59 additions and 1 deletions
26
.github/workflows/build-hardhat-project.yaml
vendored
26
.github/workflows/build-hardhat-project.yaml
vendored
|
|
@ -57,17 +57,22 @@ jobs:
|
|||
./create_image.sh
|
||||
docker push anglyuboslav/geth-smart-con
|
||||
deploy_k8s_and_app:
|
||||
needs: deploy_hardhat_project
|
||||
if: ${{ github.event.label.name == 'CI:Deploy'}}
|
||||
name: Deploy K8S Cluster in AWS and deploy GETH DEVENV
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Install kubectl
|
||||
|
||||
- name: Install kubectl
|
||||
uses: azure/setup-kubectl@v2.0
|
||||
with:
|
||||
version: 'v1.27.0'
|
||||
- name: Install Terraform
|
||||
uses: hashicorp/setup-terraform@v2
|
||||
with:
|
||||
terraform_version: "1.6.3"
|
||||
|
||||
- name: configure aws credentials
|
||||
uses: aws-actions/configure-aws-credentials@v3
|
||||
|
|
@ -75,6 +80,25 @@ jobs:
|
|||
role-to-assume: ${{ secrets.AWS_IAM_ROLE}}
|
||||
role-session-name: K8sBuildSession
|
||||
aws-region: us-east-1
|
||||
|
||||
- name: Test AWS access
|
||||
run: aws sts get-caller-identity
|
||||
|
||||
- name: Create K8S cluster with TF
|
||||
run: |
|
||||
cd terraform/eks-terraform
|
||||
terraform apply -auto-approve
|
||||
|
||||
- name: Apply YAML Manifest for the app and checks the app
|
||||
run: |
|
||||
kubectl apply -f geth-pod.yaml
|
||||
sleep 60
|
||||
kubectl get ns
|
||||
kubectl get pods -n hardhat-geth
|
||||
|
||||
- name: Delete k8s cluster
|
||||
run: |
|
||||
cd terraform/eks-terraform
|
||||
terraform destroy -auto-approve
|
||||
|
||||
|
||||
|
|
|
|||
34
geth-pod.yaml
Normal file
34
geth-pod.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: hardhat-geth
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: geth-pod
|
||||
namespace: hardhat-geth
|
||||
spec:
|
||||
containers:
|
||||
- name: geth-container
|
||||
image: anglyuboslav/geth-smart-con
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: geth-service
|
||||
namespace: hardhat-geth
|
||||
spec:
|
||||
selector:
|
||||
app: geth-pod
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
type: LoadBalancer
|
||||
Loading…
Reference in a new issue