-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9461592
commit cd42c5d
Showing
18 changed files
with
355 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
FROM golang:1.10 | ||
COPY . /go/app/ | ||
WORKDIR /go/app/ | ||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s" -o app | ||
|
||
FROM scratch | ||
COPY --from=0 /go/app / | ||
LABEL app.language=golang app.name=kanary-operator | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"math/rand" | ||
"time" | ||
) | ||
|
||
func main() { | ||
|
||
s1 := rand.NewSource(time.Now().UnixNano()) | ||
r1 := rand.New(s1) | ||
randValue := r1.Intn(100) | ||
|
||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | ||
fmt.Fprintf(w, "%d\n", randValue) | ||
}) | ||
|
||
log.Fatal(http.ListenAndServe(":8080", nil)) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: ReplicaSet | ||
metadata: | ||
name: stateful-app | ||
namespace: factor10 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: stateful | ||
template: | ||
metadata: | ||
labels: | ||
app: stateful | ||
spec: | ||
containers: | ||
- name: stateful | ||
image: etiennecoutaud/statefull-app:0.1 | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: myapp | ||
namespace: factor10 | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: stateful | ||
ports: | ||
- protocol: TCP | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: mystorage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: ReplicaSet | ||
metadata: | ||
name: nginx | ||
namespace: factor11 | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
volumes: | ||
- name: persistent-storage | ||
persistentVolumeClaim: | ||
claimName: mystorage | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine | ||
volumeMounts: | ||
- name: persistent-storage | ||
mountPath: /data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-clusterip | ||
namespace: factor4 | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: nginx | ||
type: clusterIP | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-clusterip | ||
namespace: factor4 | ||
labels: | ||
app: nginx | ||
type: clusterIP | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-lb | ||
namespace: factor4 | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
app: nginx | ||
type: lb | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-lb | ||
namespace: factor4 | ||
labels: | ||
app: nginx | ||
type: lb | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# gcloud compute firewall-rules create test --allow tcp:NODEPORT | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-nodeport | ||
namespace: factor4 | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: nginx | ||
type: nodePort | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-nodeport | ||
namespace: factor4 | ||
labels: | ||
app: nginx | ||
type: nodePort | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-1 | ||
namespace: factor5 | ||
data: | ||
nginx.properties: |- | ||
config1=value1 | ||
config2=value2 | ||
config3=value3 | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-2 | ||
namespace: factor5 | ||
data: | ||
nginx.env1: myEnv1Value | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: config-3 | ||
namespace: factor5 | ||
data: | ||
type: Opaque | ||
data: | ||
username: YWRtaW4= | ||
password: bXlfc2VjdXJlX3Bhc3N3b3Jk |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx | ||
namespace: factor5 | ||
spec: | ||
volumes: | ||
- name: nginx-config | ||
configMap: | ||
name: config-1 | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine | ||
volumeMounts: | ||
- name: nginx-config | ||
mountPath: /config | ||
env: | ||
- name: ENV_VAR_NGINX | ||
valueFrom: | ||
configMapKeyRef: | ||
name: config-2 | ||
key: nginx.env1 | ||
- name: ENV_VAR_SECRET_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: config-3 | ||
key: username | ||
- name: ENV_VAR_SECRET_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: config-3 | ||
key: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: stress-outofbound | ||
namespace: factor6 | ||
spec: | ||
containers: | ||
- name: stress | ||
image: polinux/stress | ||
resources: | ||
limits: | ||
memory: "200Mi" | ||
requests: | ||
memory: "100Mi" | ||
command: ["stress"] | ||
args: ["--vm", "1", "--vm-bytes", "250M", "--vm-hang", "1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: stress | ||
namespace: factor6 | ||
spec: | ||
containers: | ||
- name: stress | ||
image: polinux/stress | ||
resources: | ||
limits: | ||
memory: "200Mi" | ||
requests: | ||
memory: "100Mi" | ||
command: ["stress"] | ||
args: ["--vm", "1", "--vm-bytes", "150M", "--vm-hang", "1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deploy | ||
namespace: factor7 | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
#image: nginx:1.12.2-alpine | ||
image: nginx:1.13.11-alpine | ||
imagePullPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-pod | ||
namespace: factor7 | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: ReplicaSet | ||
metadata: | ||
name: nginx-rs | ||
namespace: factor7 | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
#image: nginx:1.12.2-alpine | ||
image: nginx:1.13.11-alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: liveness-exec | ||
namespace: factor8 | ||
spec: | ||
containers: | ||
- name: liveness | ||
image: k8s.gcr.io/busybox | ||
args: | ||
- /bin/sh | ||
- -c | ||
- touch /tmp/healthy; sleep 15; rm -rf /tmp/healthy; sleep 600 | ||
livenessProbe: | ||
exec: | ||
command: | ||
- cat | ||
- /tmp/healthy | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
failureThreshold: 1 | ||
successThreshold: 1 |