GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — kube · ragasang/samplejavaapp@55d9dac

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deploy
    • deploy-kube.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deploy/deploy-kube.yml‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
- hosts: "{{ env }}"
2+
become: yes
3+
tasks:
4+
- name: remove any previous app services
5+
shell: |
6+
if [ `kubectl get deploy | grep -v NAME | awk '{print $1}' | grep myapp | wc -l` -gt 0 ]; then
7+
kubectl delete deploy `kubectl get deploy | grep -v NAME | awk '{print $1}' | grep myapp`
8+
else
9+
echo "No app deployments found"
10+
fi
11+
if [ `kubectl get svc | grep myapp-svc | awk '{print $1}' | wc -l` -gt 0 ]; then
12+
kubectl delete svc `kubectl get svc | grep myapp-svc | awk '{print $1}'`
13+
else
14+
echo "No app service found"
15+
fi
16+
- name: deploy app
17+
command: kubectl create deploy myapp --image=lerndevops/samplejavaapp:{{ build }}
18+
- name: increase replicas
19+
command: kubectl scale deploy myapp --replicas=2
20+
- name: deploy service
21+
command: kubectl expose deploy myapp --name myapp-svc --port 8080 --type NodePort

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.