istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/bookinfo/platform/kube/bookinfo-mysql.yaml (about) 1 # Copyright Istio Authors 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 ################################################################################################## 16 # Mysql db services 17 # credentials: root/password 18 ################################################################################################## 19 apiVersion: v1 20 kind: Secret 21 metadata: 22 name: mysql-credentials 23 type: Opaque 24 data: 25 rootpasswd: cGFzc3dvcmQ= 26 --- 27 apiVersion: v1 28 kind: Service 29 metadata: 30 name: mysqldb 31 labels: 32 app: mysqldb 33 service: mysqldb 34 spec: 35 ports: 36 - port: 3306 37 name: tcp 38 selector: 39 app: mysqldb 40 --- 41 apiVersion: apps/v1 42 kind: Deployment 43 metadata: 44 name: mysqldb-v1 45 labels: 46 app: mysqldb 47 version: v1 48 spec: 49 replicas: 1 50 selector: 51 matchLabels: 52 app: mysqldb 53 version: v1 54 template: 55 metadata: 56 labels: 57 app: mysqldb 58 version: v1 59 spec: 60 containers: 61 - name: mysqldb 62 image: docker.io/istio/examples-bookinfo-mysqldb:1.19.1 63 imagePullPolicy: IfNotPresent 64 ports: 65 - containerPort: 3306 66 env: 67 - name: MYSQL_ROOT_PASSWORD 68 valueFrom: 69 secretKeyRef: 70 name: mysql-credentials 71 key: rootpasswd 72 args: ["--default-authentication-plugin","mysql_native_password"] 73 volumeMounts: 74 - name: var-lib-mysql 75 mountPath: /var/lib/mysql 76 volumes: 77 - name: var-lib-mysql 78 emptyDir: {} 79 ---