Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connect pet-clinic application with RDS in EKS #205

Closed
YuriiDiduk opened this issue May 22, 2022 · 0 comments
Closed

How to connect pet-clinic application with RDS in EKS #205

YuriiDiduk opened this issue May 22, 2022 · 0 comments

Comments

@YuriiDiduk
Copy link

As a database I want to use RDS. But application can't to connect RDS. App container status - crashloopbackoff. For RDS,EKS security group I specifically opened all in/out traffic. The cluster and database are located in the same VPC. When I using a simple mysql container, the application connects to app. From the mysql container pod I have access to RDS.

my application-mysql.properties

database=mysql spring.datasource.url=jdbc:mysql://{MYSQL_URL}:3306/petclinic?useUnicode=true spring.datasource.username=root spring.datasource.password=petclinic spring.datasource.initialization-mode=always spring.datasource.schema=classpath:db/mysql/schema.sql spring.datasource.data=classpath:db/mysql/data.sql

deployment.yml

spec:
  containers:
    - name: spring-petclinic
      image: repo/image_name:51
      ports:
        - name: web
          containerPort: 8181
      env:
        - name: SPRING_PROFILES_ACTIVE
          value: mysql
        - name: MYSQL_URL
          value:  here_RDS_address

ExternalName

apiVersion: v1
kind: Service
metadata:
name: externaldb
namespace: dev
spec:
type: ExternalName
externalName: here_RDS_address
selector:
app: externaldb
ports:
- name: sql
port: 3306
protocol: TCP
targetPort: 3306
nodePort: 30036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant