Install: - git - Java - Maven - docker EKS Cluster
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "route53:ListHostedZones", "route53:ListResourceRecordSets" ], "Resource": [ "" ] }, { "Effect": "Allow", "Action": [ "route53:ChangeResourceRecordSets" ], "Resource": [ "" ] } ] }
git clone https://github.com/VamsiTechTuts/externaldns-springboot.git Build artifact by using below command:
mvn clean install
docker build -t vamsitechtuts/employee-jdbc .
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
docker push vamsitechtuts/employee-jdbc
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'
kubectl get secrets
kubectl describe secrets mysql-user-pass
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
kubectl get persistentvolumes
kubectl get persistentvolumeclaims
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
kubectl apply -f employee-jdbc-deployment.yml
kubectl apply -f employee-jdbc-service.yml
kubectl apply -f mandatory.yaml
kubectl apply -f patch-configmap-l4.yaml
Create Certificates for our external-dns using AWS Certificate Manager
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
employee.naresh.com/employees