Skip to content

Commit 6897ae1

Browse files
committed
Modifying qa and prod deployments
Merge with master
2 parents 1a96880 + 5fbdac6 commit 6897ae1

File tree

7 files changed

+77
-6
lines changed

7 files changed

+77
-6
lines changed

k8s/k8s.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import (
66
"net/http"
77
)
88

9-
var (
10-
version = "1.2-yaml"
11-
bannedIp = "0.0.0.0"
12-
)
13-
149
func getServerIP() string {
1510
conn, err := net.Dial("udp", "8.8.8.8:80")
1611
if err != nil {
@@ -25,7 +20,7 @@ func playHome(w http.ResponseWriter, r *http.Request) {
2520
<img src="https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/1.2.png">
2621
<h1 style="color:green">Playing with Kubernetes</h1>
2722
<h2 style="color:blue">Your server IP:` + getServerIP() + `</h2>
28-
<h3 style="color:blue">Version: twogghub/k8s-workshop:` + version + `</h3>
23+
<h3 style="color:blue">Version: twogghub/k8s-workshop:1.2-yaml</h3>
2924
</center></body></html>`
3025
fmt.Fprintf(w, html)
3126
}
File renamed without changes.

src/1.3.1.png

120 KB
Loading

src/1.3.2.png

158 KB
Loading

yamls/k8sdp.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: k8sdp
5+
spec:
6+
replicas: 3
7+
strategy:
8+
type: RollingUpdate
9+
rollingUpdate:
10+
maxSurge: 1
11+
maxUnavailable: 1
12+
selector:
13+
matchLabels:
14+
env: k8sdp
15+
template:
16+
metadata:
17+
labels:
18+
env: k8sdp
19+
annotations:
20+
kubernetes.io/change-cause: "HttpGet /health return error!"
21+
spec:
22+
containers:
23+
- image: twogghub/k8s-workshop:1.3-liveness
24+
name: k8sdp
25+
livenessProbe:
26+
httpGet:
27+
path: /health
28+
port: 8080
29+
initialDelaySeconds: 5
30+
timeoutSeconds: 1
31+
periodSeconds: 2
32+
failureThreshold: 1
33+
ports:
34+
- name: http
35+
containerPort: 8080

yamls/k8sprod.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: k8sprod
5+
spec:
6+
replicas: 2
7+
strategy:
8+
type: RollingUpdate
9+
rollingUpdate:
10+
maxSurge: 1
11+
maxUnavailable: 1
12+
template:
13+
metadata:
14+
labels:
15+
env: prod
16+
spec:
17+
containers:
18+
- image: twogghub/k8s-workshop:1.2-yaml
19+
name: k8sprod
20+
ports:
21+
- name: http
22+
containerPort: 8080

yamls/k8sqa.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: k8sqa
5+
spec:
6+
replicas: 2
7+
strategy:
8+
type: Recreate
9+
template:
10+
metadata:
11+
labels:
12+
env: qa
13+
spec:
14+
containers:
15+
- image: twogghub/k8s-workshop:1.2-qaonly
16+
name: k8sqa
17+
ports:
18+
- name: http
19+
containerPort: 9090

0 commit comments

Comments
 (0)