forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#4828 from sub-mod/v1beta3_json_3
Update examples to support v1beta3 api - liveness/mysql-wordpress
- Loading branch information
Showing
6 changed files
with
160 additions
and
0 deletions.
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,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 | ||
|
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: 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 | ||
|
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,12 @@ | ||
apiVersion: v1beta3 | ||
kind: Service | ||
metadata: | ||
labels: | ||
name: mysql | ||
name: mysql | ||
spec: | ||
containerPort: 3306 | ||
port: 3306 | ||
selector: | ||
name: mysql | ||
|
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,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
12
examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml
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,12 @@ | ||
apiVersion: v1beta3 | ||
kind: Service | ||
metadata: | ||
labels: | ||
name: wpfrontend | ||
name: wpfrontend | ||
spec: | ||
containerPort: 80 | ||
port: 80 | ||
selector: | ||
name: wpfrontend | ||
|
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,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 | ||
|