Coder Social home page Coder Social logo

externaldns-springboot's Introduction

Create External-DNS for Springboot Application

Pre-requisites:

 Install: - git - Java - Maven - docker  EKS Cluster

Attach below policy to Node Instance Role

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "route53:ListHostedZones", "route53:ListResourceRecordSets" ], "Resource": [ "" ] }, { "Effect": "Allow", "Action": [ "route53:ChangeResourceRecordSets" ], "Resource": [ "" ] } ] }

Get Source Code from github:

git clone https://github.com/VamsiTechTuts/externaldns-springboot.git Build artifact by using below command:

mvn clean install

Create docker image:

docker build -t vamsitechtuts/employee-jdbc .

Docker login:

We need to login before push image to docker hub docker login [root@ip-172-31-29-58 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE vamsitechtuts/employee-jdbc latest 92cbaf11321e 8 minutes ago 134MB openjdk 8-jdk-alpine a3562aa0b991 12 months ago 105MB Tag docker image:

docker tag 92cbaf11321e vamsitechtuts/employee-jdbc

push docker image to docker hub:

docker push vamsitechtuts/employee-jdbc

Creating the secrets:

You can create secrets manually from a literal or file using the kubectl create secret command, or you can create them from a generator using Kustomize. In this article, we’re gonna create the secrets manually:

kubectl create secret generic mysql-root-pass --from-literal=password=Vamsi#240
kubectl create secret generic mysql-user-pass --from-literal=username=vamsi --from-literal=password=Vamsi#240
kubectl create secret generic mysql-db-url --from-literal=database=mysqldb --from-literal=url='jdbc:mysql://employee-jdbc-mysql:3306/mysqldb'

You can check the secrets:

kubectl get secrets
kubectl describe secrets mysql-user-pass

Deploying MySQL & PV:

kubectl apply -f mysql-service.yml
kubectl apply -f mysql.deployment.yml
kubectl apply -f mysql-pv.yml
kubectl apply -f mysql-pv-claim.yml

To check Persistent volumes and Persistentvolumeclaim:

kubectl get persistentvolumes
kubectl get persistentvolumeclaims

Logging into the MySQL pod:

You can get the MySQL pod and use kubectl exec command to login to the Pod.

kubectl get pods
kubectl exec -it employee-jdbc-mysql-74d88fd675-cbnbf -- /bin/bash

Login in to mysql:

mysql -u naresh -p

Change database to mysqldb:

use mysqldb;

Create table with the name of employee:

create table employee(empId varchar(40), empName varchar(40));

Now exit from pod:

exit

Deploying the Spring Boot app on Kubernetes:

kubectl apply -f employee-jdbc-deployment.yml
kubectl apply -f employee-jdbc-service.yml

Deploying mandatory files for

kubectl apply -f mandatory.yaml
kubectl apply -f patch-configmap-l4.yaml

Create Certificates:

Create Certificates for our external-dns using AWS Certificate Manager

Deploying externaldns, service and ingress:

change our external dns in below yml files and certificate arn

kubectl apply -f external-dns.yaml
kubectl apply -f service-l4.yaml
kubectl apply -f ingress.yml

Check output with External-dns with API:

employee.naresh.com/employees

externaldns-springboot's People

Contributors

vamsitechtuts avatar

Watchers

James Cloos avatar  avatar

Forkers

srinadhm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.