Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/maven/io.swagger.core.v3-swagger-…
Browse files Browse the repository at this point in the history
…annotations-2.2.26
  • Loading branch information
conorheffron authored Nov 30, 2024
2 parents 0aa5c64 + 67305aa commit a8bb9fd
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 7 deletions.
85 changes: 83 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
Personal website / portfolio [https://www.ironoc.net/](https://www.ironoc.net/)

## Tech Stack
Java 21 (LTS), Spring Boot 3.3, ReactJs 18, Maven 3.8, HTML5+CSS, Docker / Bash, AWS
Java 21 (LTS), Spring Boot 3.3, ReactJs 18, Maven 3.8, HTML5+CSS,
Docker / Bash, AWS, minikube, & kubectl.

## Run without cloning project:
```
Expand All @@ -27,7 +28,13 @@ docker run -d --restart=always -p 8080:8080 conorheffron/ironoc
## Run after project checkout (JDK 21 & Maven 3.8.3 required)
Build / Run App:
```
mvn clean package spring-boot:run
mvn clean package
mvn -DAWS_ACCESS_KEY_ID=<val1> \
-DAWS_REGION=<val2> \
-DAWS_SECRET_ACCESS_KEY=<val3> \
-DAWS_SESSION_TOKEN=<val4> \
spring-boot:run
```

![image](screen-grabs/IDEA-Intellj-run.png)
Expand All @@ -51,4 +58,78 @@ docker-compose down
# Screenshot
![Home](screen-grabs/home-page.png)

# Local k8s cluster with Minikube:

MiniKube Install Notes for mac users
```
brew install kubectl
brew install virtualbox
brew install minikube
```

```
Oracle VirtualBox Manager v7.1.4
% kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.31.0
% minikube version
minikube version: v1.34.0
commit: 210b148df93a80eb872ecbeb7e35281b3c582c61
% docker version
Client:
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:38:18 2024
OS/Arch: darwin/amd64
Context: desktop-linux
```

- Open terminal
```
cd k8s/
# (clean-up & again after local testing complete)
minikube delete
minikube start --driver=docker
kubectl cluster-info
minikube dashboard
```

### Then change namespace in browser from default to ironoc-ns
- i.e. http://127.0.0.1:56414/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/pod?namespace=ironoc-ns

### Open New tab in terminal & create deployment
```
docker image build -t ironoc .
minikube image load ironoc:latest
kubectl create ns ironoc-ns
kubectl apply -f k8s/ironoc.yaml --namespace=ironoc-ns
kubectl get pods --namespace=ironoc-ns
kubectl get deployment --namespace=ironoc-ns
kubectl expose deployment ironoc-app-deployment --type=NodePort --namespace=ironoc-ns
kubectl get svc --namespace=ironoc-ns
minikube service ironoc-app-deployment --url --namespace=ironoc-ns
```

### Open New tab in terminal & tail logs
```
% kubectl get pods --namespace=ironoc-ns
NAME READY STATUS RESTARTS AGE
ironoc-app-deployment-6d84f75b44-kpqpj 1/1 Running 0 3m37s
kubectl logs ironoc-app-deployment-6d84f75b44-kpqpj -f --namespace=ironoc-ns
```
207 changes: 207 additions & 0 deletions k8s/ironoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ironoc-app-deployment
managedFields:
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
'f:spec':
'f:replicas': {}
manager: vpa-recommender
operation: Update
subresource: scale
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
'f:metadata':
'f:labels':
.: {}
'f:app': {}
'f:spec':
'f:progressDeadlineSeconds': {}
'f:revisionHistoryLimit': {}
'f:selector': {}
'f:strategy':
'f:rollingUpdate':
.: {}
'f:maxSurge': {}
'f:maxUnavailable': {}
'f:type': {}
'f:template':
'f:metadata':
'f:labels':
.: {}
'f:app': {}
'f:spec':
'f:containers':
'k:{"name":"ironoc-app-sha256-1"}':
.: {}
'f:image': {}
'f:imagePullPolicy': {}
'f:name': {}
'f:resources': {}
'f:terminationMessagePath': {}
'f:terminationMessagePolicy': {}
'f:dnsPolicy': {}
'f:restartPolicy': {}
'f:schedulerName': {}
'f:securityContext': {}
'f:terminationGracePeriodSeconds': {}
manager: unknown
operation: Update
time: '2024-10-15T11:53:53Z'
- apiVersion: apps/v1
fieldsType: FieldsV1
fieldsV1:
'f:metadata':
'f:annotations':
'f:deployment.kubernetes.io/revision': {}
'f:status':
'f:availableReplicas': {}
'f:conditions':
.: {}
'k:{"type":"Available"}':
.: {}
'f:lastTransitionTime': {}
'f:lastUpdateTime': {}
'f:message': {}
'f:reason': {}
'f:status': {}
'f:type': {}
'k:{"type":"Progressing"}':
.: {}
'f:lastTransitionTime': {}
'f:lastUpdateTime': {}
'f:message': {}
'f:reason': {}
'f:status': {}
'f:type': {}
'f:observedGeneration': {}
'f:readyReplicas': {}
'f:replicas': {}
'f:unavailableReplicas': {}
'f:updatedReplicas': {}
manager: kube-controller-manager
operation: Update
subresource: status
time: '2024-10-15T12:04:58Z'
name: ironoc-app-deployment
namespace: ironoc-ns
spec:
replicas: 1
selector:
matchLabels:
app: ironoc-app-deployment
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: ironoc-app-deployment
spec:
containers:
- image: ironoc:latest
imagePullPolicy: Never
ports:
- containerPort: 8080
name: ironoc-app-sha256-1
resources:
limits:
ephemeral-storage: 1Gi
requests:
cpu: 500m
ephemeral-storage: 1Gi
memory: 2Gi
securityContext:
capabilities:
drop:
- NET_RAW
securityContext:
seccompProfile:
type: RuntimeDefault
tolerations:
- effect: NoSchedule
key: kubernetes.io/arch
operator: Equal
value: amd64
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
labels:
app: ironoc-app-deployment
managedFields:
- apiVersion: autoscaling/v2
fieldsType: FieldsV1
fieldsV1:
'f:metadata':
'f:labels':
.: {}
'f:app': {}
'f:spec':
'f:maxReplicas': {}
'f:metrics': {}
'f:minReplicas': {}
'f:scaleTargetRef':
'f:apiVersion': {}
'f:kind': {}
'f:name': {}
manager: unknown
operation: Update
time: '2024-10-15T11:53:54Z'
- apiVersion: autoscaling/v2
fieldsType: FieldsV1
fieldsV1:
'f:status':
'f:conditions':
.: {}
'k:{"type":"AbleToScale"}':
.: {}
'f:lastTransitionTime': {}
'f:message': {}
'f:reason': {}
'f:status': {}
'f:type': {}
'k:{"type":"ScalingActive"}':
.: {}
'f:lastTransitionTime': {}
'f:message': {}
'f:reason': {}
'f:status': {}
'f:type': {}
'k:{"type":"ScalingLimited"}':
.: {}
'f:lastTransitionTime': {}
'f:message': {}
'f:reason': {}
'f:status': {}
'f:type': {}
'f:currentMetrics': {}
'f:currentReplicas': {}
'f:desiredReplicas': {}
'f:lastScaleTime': {}
manager: vpa-recommender
operation: Update
subresource: status
time: '2024-10-15T12:03:57Z'
name: ironoc-app-deployment-hpa-kbij
namespace: ironoc-ns
spec:
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 80
type: Utilization
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ironoc-app-deployment
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.5</version>
<version>3.4.0</version>
<relativePath />
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>21</java.version>
<spring.version>3.3.5</spring.version>
<spring.version>3.4.0</spring.version>
<frontend-maven-plugin.version>1.15.1</frontend-maven-plugin.version>
<node.version>v20.16.0</node.version>
<npm.version>10.8.1</npm.version>
Expand Down Expand Up @@ -125,7 +125,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.17.0</version>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -136,7 +136,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.6.0</version>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
Expand All @@ -147,7 +147,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java</artifactId>
<version>2.29.15</version>
<version>2.29.20</version>
</dependency>
</dependencies>

Expand Down

0 comments on commit a8bb9fd

Please sign in to comment.