10000 fix some unsatisfied. (#8746) · ArduinoBot/website@7569e58 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7569e58

Browse files
Chen Hongk8s-ci-robot
Chen Hong
authored andcommitted
fix some unsatisfied. (kubernetes#8746)
* fix some unsatisfied. * fix * add mysql-pv.yaml for run-single-instance-stateful-application * fix some errors.
1 parent 25d5666 commit 7569e58

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

content/en/docs/tasks/run-application/mysql-deployment.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ spec:
99
app: mysql
1010
clusterIP: None
1111
---
12-
apiVersion: v1
13-
kind: PersistentVolumeClaim
14-
metadata:
15-
name: mysql-pv-claim
16-
spec:
17-
accessModes:
18-
- ReadWriteOnce
19-
resources:
20-
requests:
21-
storage: 20Gi
22-
---
2312
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
2413
kind: Deployment
2514
metadata:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
kind: PersistentVolume
2+
apiVersion: v1
3+
metadata:
4+
name: mysql-pv-volume
5+
labels:
6+
type: local
7+
spec:
8+
storageClassName: manual
9+
capacity:
10+
storage: 20Gi
11+
accessModes:
12+
- ReadWriteOnce
13+
hostPath:
14+
path: "/mnt/data"
15+
---
16+
apiVersion: v1
17+
kind: PersistentVolumeClaim
18+
metadata:
19+
name: mysql-pv-claim
20+
spec:
21+
storageClassName: manual
22+
accessModes:
23+
- ReadWriteOnce
24+
resources:
25+
requests:
26+
storage: 20Gi

content/en/docs/tasks/run-application/run-single-instance-stateful-application.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ Note: The password is defined in the config yaml, and this is insecure. See
4949
for a secure solution.
5050

5151
{{< code file="mysql-deployment.yaml" >}}
52+
{{< code file="mysql-pv.yaml" >}}
53+
54+
1. Deploy the PV and PVC of the YAML file:
55+
56+
kubectl create -f https://k8s.io/docs/tasks/run-application/mysql-pv.yaml
5257

5358
1. Deploy the contents of the YAML file:
5459

55-
kubectl create -f https://k8s.io/docs/tasks/run-application/mysql-deployment.yaml
60+
kubectl create -f https://k8s.io/docs/tasks/run-application/mysql-deployment.yaml
5661

5762
1. Display information about the Deployment:
5863

59-
kubectl describe deployment mysql
64+
kubectl describe deployment mysql
6065

6166
Name: mysql
6267
Namespace: default
@@ -96,14 +101,14 @@ for a secure solution.
96101

97102
1. List the pods created by the Deployment:
98103

99-
kubectl get pods -l app=mysql
104+
kubectl get pods -l app=mysql
100105

101106
NAME READY STATUS RESTARTS AGE
102107
mysql-63082529-2z3ki 1/1 Running 0 3m
103108

104109
1. Inspect the PersistentVolumeClaim:
105110

106-
kubectl describe pvc mysql-pv-claim
111+
kubectl describe pvc mysql-pv-claim
107112

108113
Name: mysql-pv-claim
109114
Namespace: default
@@ -165,6 +170,7 @@ Delete the deployed objects by name:
165170
```
166171
kubectl delete deployment,svc mysql
167172
kubectl delete pvc mysql-pv-claim
173+
kubectl delete pv mysql-pv-volume
168174
```
169175

170176
If you manually provisioned a PersistentVolume, you also need to manually

test/examples_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ func TestExampleObjectSchemas(t *testing.T) {
474474
"deployment-update": {&extensions.Deployment{}},
475475
"hpa-php-apache": {&autoscaling.HorizontalPodAutoscaler{}},
476476
"mysql-configmap": {&api.ConfigMap{}},
477-
"mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}},
477+
"mysql-deployment": {&api.Service{}, &extensions.Deployment{}},
478+
"mysql-pv": {&api.PersistentVolume{}, &api.PersistentVolumeClaim{}},
478479
"mysql-services": {&api.Service{}, &api.Service{}},
479480
"mysql-statefulset": {&apps.StatefulSet{}},
480481
},

0 commit comments

Comments
 (0)
0