diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8b241f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/* \ No newline at end of file diff --git a/README.md b/README.md index be4d10d..4558657 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ -# springboot-k8s-yaml \ No newline at end of file +# springboot-k8s-yaml + +1. Run spring boot app in docker \ +```docker build -t springboot-k8-example:1.1 . ``` +2. Create/update deployment \ +``` kubectl apply -f deployment.yaml``` +3. check the deployment \ +```kubectl get deployments``` +4. check the pods \ +``` kubectl get pods``` +5. Get deployment logs \ +``` kubectl logs deployment/spring-boot-k8s``` +6. Get pod log \ +```kubectl logs ``` +7. run service file \ +``` kubectl apply -f .\service.yaml``` +8. Get all the service \ +```kubectl get svc``` +9. access the link using \ +``` NodeInternalIP:``` + + +Reference: +1. https://stackoverflow.com/questions/60518658/how-to-get-logs-of-deployment-from-kubernetes +2. \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml index b19ed21..85d2b01 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -6,7 +6,7 @@ spec: selector: matchLabels: app: spring-boot-k8s - replicas: 2 # Number of replicas that will be created for this deployment + replicas: 3 # Number of replicas that will be created for this deployment template: metadata: labels: @@ -14,7 +14,7 @@ spec: spec: containers: - name: spring-boot-k8s - image: springboot-k8s-example:1.0 # Image that will be used to containers in the cluster + image: springboot-k8-example:1.1 # Image that will be used to containers in the cluster imagePullPolicy: IfNotPresent ports: - containerPort: 8080 # The port that the container is running on in the cluster \ No newline at end of file