Skip to content

Commit f7d8150

Browse files
committed
somehow was missing all content
1 parent fa4b085 commit f7d8150

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

docs/usage/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Using MicroShift
2+
MicroShift operates similar to many other Kubernetes providers. This means that you can use the same tools to deploy and manage your applications.
3+
4+
All of the standard Kubernetes management tools can be used to maintain and modify your MicroShift applications. Below we will show some examples using kubectl, kustomize, and helm to deploy and maintain applications.
5+
6+
## Example Applications
7+
8+
### Metal LB
9+
Metal LB is a load balancer that can be used to route traffic to a number of backends.
10+
11+
Creating the Metal LB namespace and deployment.
12+
```
13+
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/namespace.yaml
14+
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/metallb.yaml
15+
```
16+
17+
Once the components are available a configMap is required to define the address pool for the load balancer to use.
18+
19+
Create the configmap.yaml file
20+
```
21+
vi configmap.yaml
22+
23+
apiVersion: v1
24+
kind: ConfigMap
25+
metadata:
26+
namespace: metallb-system
27+
name: config
28+
data:
29+
config: |
30+
address-pools:
31+
- name: default
32+
protocol: layer2
33+
addresses:
34+
- 192.168.1.240-192.168.1.250
35+
```
36+
37+
Load the configMap into the cluster.
38+
```
39+
kubectl create -f /tmp/configmap.yaml
40+
```
41+
42+
Now we are able to deploy a test application to verify thing are working as expected.
43+
44+
```
45+
kubectl create ns test
46+
kubectl create deployment nginx -n test --image nginx
47+
```
48+
49+
Create the following file to be used for the service.
50+
```
51+
vi service.yaml
52+
53+
apiVersion: v1
54+
kind: Service
55+
metadata:
56+
name: nginx
57+
annotations:
58+
metallb.universe.tf/address-pool: default
59+
spec:
60+
ports:
61+
- port: 80
62+
targetPort: 80
63+
selector:
64+
app: nginx
65+
type: LoadBalancer
66+
```
67+
68+
Use kubectl to create the service.
69+
```
70+
kubectl create -f service.yaml -n test
71+
```
72+
73+
Verify the service exists and that an IP address has been assigned.
74+
```
75+
kubectl get svc -n test
76+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
77+
nginx LoadBalancer 10.43.183.104 192.168.1.241 80:32434/TCP 29m
78+
```
79+
80+
Using your browser you can now access the NGINX application by the `EXTERNAL-IP` provided by the service.

0 commit comments

Comments
 (0)