Skip to content

Commit

Permalink
Merge pull request #2 from gadkins/main
Browse files Browse the repository at this point in the history
Remove kustomization; update readme
  • Loading branch information
gadkins authored Sep 28, 2023
2 parents f84c11e + 5e305e9 commit 512d5ec
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 76 deletions.
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
### Hello World K8s
# Hello World for Uffizzi Virtual Clusters (~2 min)

## ~ 2 minutes
This repo demonstrates how you can create Kubernetes virtual cluster on Uffizzi Cloud, the apply manifests for an example application.

This example demonstrates how you can deploy a simple k8s application on a Uffizzi Cluster.


1. Login to your Uffizzi account
1. Clone this repository
```
uffizzi login
git clone https://github.com/UffizziCloud/hello-world.git && \
cd hello-world
```

2. Create a Uffizzi cluster
2. Authenticate with Uffizzi. This command will open a browser window for you to login or create an account.
```
uffizzi cluster create
uffizzi login
```

3. Update local kubeconfig with the Uffizzi cluster's kubeconfig
3. Create a Uffizzi cluster
```
uffizzi cluster update-kubeconfig coolbean-cole
uffizzi cluster create hello
# [⠦] Creating cluster hello...
```

4. Apply Kubernetes Manifests
```
kubectl apply -f ./k8s
kubectl apply -f ./manifests
```
Wait for the deployment to come up
Wait for the deployment to come up

5. Get the Ingress to the deployed application
5. Get the Ingress to the deployed application
```
kubectl get ingress web --kubeconfig kubeconfig -o json | jq '.spec.rules[0].host' | tr -d '"'
kubectl get ingress web --kubeconfig ~/.kube/config -o json | jq '.spec.rules[0].host' | tr -d '"'
```

The host address should look something like this:
> `web-default-hello-c850.uclusters.app.uffizzi.com`
Copy and past this address into your browser to see the application running.

7. Cleanup
```
uffizzi cluster delete hello
```
19 changes: 0 additions & 19 deletions k8s/deployment.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions k8s/ingress.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions k8s/service.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions kustomization.yaml

This file was deleted.

52 changes: 52 additions & 0 deletions manifests/web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
apiVersion: v1
kind: Service
metadata:
name: web
spec:
ports:
- port: 3000
name: http
type: ClusterIP
selector:
app: web
---
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: 3000
path: /
pathType: Prefix
tls:
- hosts:
- web.example.com
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: uffizzi/hello-world-k8s
ports:
- containerPort: 3000
3 changes: 0 additions & 3 deletions project.toml

This file was deleted.

0 comments on commit 512d5ec

Please sign in to comment.