Skip to content

Commit

Permalink
#6 - kubernetes start
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems committed Aug 29, 2024
1 parent 2909bd9 commit 8f32751
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 2 deletions.
8 changes: 8 additions & 0 deletions biometric-nbi/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand Down Expand Up @@ -36,6 +37,13 @@
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
Expand Down
15 changes: 13 additions & 2 deletions biometric-nbi/.project
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -25,4 +25,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1722641996979</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
1 change: 1 addition & 0 deletions biometric-nbi/src/kubernetes/mysql-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Service
metadata:
name: mysql
spec:
# kubectl port-forward mysql-58b7767464-dgpf4 3306:3306
ports:
- protocol: TCP
port: 3306
Expand Down
16 changes: 16 additions & 0 deletions biometric-nbi/src/kubernetes/prometheus-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
data:
prometheus.yml: |
global:
scrape_interval: 30s
scrape_timeout: 25s
scrape_configs:
- job_name: "proemtheus"
static_configs:
- targets: ["localhost:9090"]
kind: ConfigMap
metadata:
namespace: prometheus
name: prometheus-configmap
44 changes: 44 additions & 0 deletions biometric-nbi/src/kubernetes/prometheus-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: prometheus
name: prometheus-deploy
namespace: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
containers:
- name: prometheus-container
image: prom/prometheus:latest
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config-file
mountPath: /etc/prometheus
- name: prometheus-data-storage
mountPath: /prometheus
volumes:
- name: prometheus-config-file
configMap:
name: prometheus-configmap
- name: prometheus-data-storage
persistentVolumeClaim:
claimName: prometheus-data-pvc
17 changes: 17 additions & 0 deletions biometric-nbi/src/kubernetes/prometheus-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: prometheus-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
namespace: prometheus
labels:
app: prometheus
spec:
type: LoadBalancer
selector:
app: prometheus
ports:
- protocol: TCP
port: 9090
targetPort: 9090
13 changes: 13 additions & 0 deletions biometric-nbi/src/kubernetes/prometheus-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prometheus-data-pvc
namespace: prometheus
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 2Gi

0 comments on commit 8f32751

Please sign in to comment.