Skip to content

Commit

Permalink
Delt opp minikube deploy i frontend og backend. Oppdatert README
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasnokling committed Feb 20, 2018
1 parent 60915ce commit 9f8a96e
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 33 deletions.
56 changes: 51 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,57 @@
Kjøring av en enkelt pod, Oppsett av cats and dogs applikasjonen til fagdag. Har oppsett til minikube og azure


## Minikube
### Minikube oppgave

##Start minikube og list servicer
```
minikube start
```

Se hvilke servicer som er eksponert
```
minikube service list
```

##Deploy backend
```
kubectl create -f backend.yml
```
kubectl create namespace "unikt_navn"
kubectl run cheat --namespace="unikt_navn" --port=80 coderpews/kubernetes-cheat:0.1
kubectl config set-context $(kubectl config current-context) --namespace=unikt_navn

Sjekk at deploy finnes
```
kubectl get deploy
```

Sjekk at pod finnes
```
kubectl get pod
```

##Deploy frontend
```
kubectl create -f frontend.yml
```

Sjekk at deploy finnes
```
kubectl get deploy
```

Sjekk at pod finnes
```
kubectl get pod
```

Sjekk at servicer er eksponert
```
kubectl get service
```

##Sjekk at samme servicer finnes i minikube, og åpne frontenden i browser
```
minikube service list
minikube service azure-vote-front
```


Expand All @@ -33,7 +79,7 @@ Lage namespace. Sliter du med å finne namespace navn, kan du bruke denne tjenes
kubectl create namepsace "ditt-namespace-navn"
kubectl config set-context $(kubectl config current-context) --namespace=ditt-namespace-navn
```
```
### Azure oppgave 3
Kjøre deployment via kommandolinje
Expand Down
27 changes: 27 additions & 0 deletions minikube/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-back
spec:
containers:
- name: azure-vote-back
image: redis
ports:
- containerPort: 6379
name: redis
---
apiVersion: v1
kind: Service
metadata:
name: azure-vote-back
spec:
ports:
- port: 6379
selector:
app: azure-vote-back
28 changes: 0 additions & 28 deletions minikube/deploy_mini.yml → minikube/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-back
spec:
containers:
- name: azure-vote-back
image: redis
ports:
- containerPort: 6379
name: redis
---
apiVersion: v1
kind: Service
metadata:
name: azure-vote-back
spec:
ports:
- port: 6379
selector:
app: azure-vote-back
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-front
spec:
Expand Down

0 comments on commit 9f8a96e

Please sign in to comment.