Skip to content
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
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@

Sample Java Applicaiton V1.2
ravi change

this sample file for testing
21 changes: 21 additions & 0 deletions deploy/deploy-kube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- hosts: "{{ env }}"
become: yes
tasks:
- name: remove any previous app services
shell: |
if [ `kubectl get deploy | grep -v NAME | awk '{print $1}' | grep myapp | wc -l` -gt 0 ]; then
kubectl delete deploy `kubectl get deploy | grep -v NAME | awk '{print $1}' | grep myapp`
else
echo "No app deployments found"
fi
if [ `kubectl get svc | grep myapp-svc | awk '{print $1}' | wc -l` -gt 0 ]; then
kubectl delete svc `kubectl get svc | grep myapp-svc | awk '{print $1}'`
else
echo "No app service found"
fi
- name: deploy app
command: kubectl create deploy myapp --image=lerndevops/samplejavaapp:{{ build }}
- name: increase replicas
command: kubectl scale deploy myapp --replicas=2
- name: deploy service
command: kubectl expose deploy myapp --name myapp-svc --port 8080 --type NodePort