Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples to support v1beta3 api - liveness/mysql-wordpress #4828

Merged
merged 2 commits into from
Feb 27, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion examples/hazelcast/v1beta3/hazelcast-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ spec:
name: hazelcast
spec:
containers:
- cpu: 1000
- resources:
limits:
cpu: 1000m
image: pires/hazelcast-k8s
name: hazelcast
ports:
Expand Down
29 changes: 29 additions & 0 deletions examples/liveness/v1beta3/exec-liveness.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1beta3
kind: ReplicationController
metadata:
labels:
test: liveness
name: liveness-exec
spec:
replicas: 1
selector:
test: liveness
template:
metadata:
labels:
test: liveness
spec:
containers:
- command:
- "/bin/sh"
- "-c"
- "echo ok > /tmp/health; sleep 10; echo fail > /tmp/health; sleep 600"
image: busybox
livenessProbe:
exec:
command:
- "cat"
- "/tmp/health"
initialDelaySeconds: 15
name: liveness

26 changes: 26 additions & 0 deletions examples/liveness/v1beta3/http-liveness.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1beta3
kind: ReplicationController
metadata:
labels:
test: liveness
name: liveness-http
spec:
replicas: 1
selector:
test: liveness
template:
metadata:
labels:
test: liveness
spec:
containers:
- command:
- "/server"
image: kubernetes/liveness
livenessProbe:
httpGet:
path: "/healthz"
port: 8080
initialDelaySeconds: 15
name: liveness

12 changes: 12 additions & 0 deletions examples/mysql-wordpress-pd/v1beta3/mysql-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1beta3
kind: Service
metadata:
labels:
name: mysql
name: mysql
spec:
containerPort: 3306
port: 3306
selector:
name: mysql

42 changes: 42 additions & 0 deletions examples/mysql-wordpress-pd/v1beta3/mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1beta3
kind: ReplicationController
metadata:
labels:
name: mysql
name: mysql
spec:
replicas: 1
selector:
name: mysql
template:
metadata:
labels:
name: mysql
spec:
containers:
- resources:
limits :
cpu: 1000m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as @vishh's comment on the other PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpu can be 1 instead of 1000m.

image: mysql
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
# change this
value: yourpassword
ports:
- containerPort: 3306
name: mysql
volumeMounts:
# name must match the volume name below
- name: mysql-persistent-storage
# mount path within the container
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
source:
# emptyDir: {}
persistentDisk:
# This GCE PD must already exist.
pdName: mysql-disk
fsType: ext4

12 changes: 12 additions & 0 deletions examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1beta3
kind: Service
metadata:
labels:
name: wpfrontend
name: wpfrontend
spec:
containerPort: 80
port: 80
selector:
name: wpfrontend

39 changes: 39 additions & 0 deletions examples/mysql-wordpress-pd/v1beta3/wordpress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1beta3
kind: ReplicationController
metadata:
labels:
name: wordpress
name: wordpress
spec:
replicas: 1
selector:
name: wordpress
template:
metadata:
labels:
name: wordpress
spec:
containers:
image: wordpress
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a -

name: wordpress
env:
- name: WORDPRESS_DB_PASSWORD
# change this - must match mysql.yaml password
value: yourpassword
ports:
- containerPort: 80
name: wordpress
volumeMounts:
# name must match the volume name below
- name: wordpress-persistent-storage
# mount path within the container
mountPath: /var/www/html
volumes:
- name: wordpress-persistent-storage
source:
# emptyDir: {}
persistentDisk:
# This GCE PD must already exist.
pdName: wordpress-disk
fsType: ext4