kubernetes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
--- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-mysql-keycloak-dev spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: cbs # volumeName: pvc-mysql-keycloak-dev # selector: # matchLabels: # app: pv-mysql-keycloak-dev --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: mysql-keycloak-deploy-dev spec: replicas: 1 template: metadata: labels: app: mysql-keycloak-dev spec: containers: - name: mysql-keycloak-dev image: mysql:5.7 ports: - containerPort: 8080 volumeMounts: - name: mysql-data mountPath: /var/lib/mysql env: - name: MYSQL_ROOT_PASSWORD value: Lookeng2018 - name: MYSQL_DATABASE value: keycloak volumes: - name: mysql-data persistentVolumeClaim: claimName: pvc-mysql-keycloak-dev --- apiVersion: v1 kind: Service metadata: name: mysql-keycloak-service-dev spec: selector: app: mysql-keycloak-dev ports: - name: tcp3306 protocol: TCP port: 3306 targetPort: 3306 type: ClusterIP |
&nbs… Read More