Skip to content

Commit

Permalink
Merge pull request kubernetes#4828 from sub-mod/v1beta3_json_3
Browse files Browse the repository at this point in the history
Update examples to support v1beta3 api - liveness/mysql-wordpress
  • Loading branch information
bgrant0607 committed Feb 27, 2015
2 parents 53f7534 + efaf274 commit 987cabd
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 0 deletions.
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: 1
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
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

0 comments on commit 987cabd

Please sign in to comment.