Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore e2e #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: registry.uffizzi.com/quickstart
ports:
- containerPort: 8080
20 changes: 20 additions & 0 deletions .github/k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
spec:
ingressClassName: uffizzi
rules:
- host: web.example.com
http:
paths:
- backend:
service:
name: web
port:
number: 8080
path: /
pathType: Prefix
tls:
- hosts:
- web.example.com
6 changes: 6 additions & 0 deletions .github/k8s/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- ingress.yaml
- service.yaml
10 changes: 10 additions & 0 deletions .github/k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: web
spec:
ports:
- port: 8080
type: ClusterIP
selector:
app: web
25 changes: 15 additions & 10 deletions .github/workflows/uffizzi-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: ./
context: ./src
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down Expand Up @@ -88,21 +88,26 @@ jobs:
with:
cluster-name: pr-${{ github.event.pull_request.number }}-e2e-helm
server: https://app.uffizzi.com
k8s-version: 1.28
kubeconfig: kubeconfig

- name: Apply Kustomize to test the new image
id: prev
run: |
# Change the image name to those just built and pushed.
kustomize edit set image uffizzi/hello-world-k8s=${{ needs.build-image.outputs.tags }}

if [[ ${RUNNER_DEBUG} == 1 ]]; then
cat kustomization.yaml
echo "`pwd`"
echo "`ls`"
pwd
ls -la
fi

# Apply kustomized manifests to virtual cluster.
kubectl apply --kustomize . --kubeconfig ./kubeconfig
(
cp ./kubeconfig ./.github/k8s
cd .github/k8s
# Change the image name to those just built and pushed.
kustomize edit set image uffizzi/hello-world-k8s=${{ needs.build-image.outputs.tags }}


# Apply kustomized manifests to virtual cluster.
kubectl apply --kustomize . --kubeconfig ./kubeconfig
)

# Allow uffizzi to sync the resources
sleep 5
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/node_modules
.idea
Loading