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

Remove kustomization; update readme #2

Merged
merged 2 commits into from
Sep 28, 2023
Merged
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
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.

Loading