Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hello-world-spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josh Steinberg
hello-world-spring-boot
Commits
d660c3aa
Commit
d660c3aa
authored
Jun 17, 2022
by
Josh Steinberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update helm chart
parent
da87fce8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
61 additions
and
40 deletions
+61
-40
Dockerfile
Dockerfile
+1
-1
Jenkinsfile
Jenkinsfile
+3
-1
.helmignore
helm/hello-world-spring-boot/.helmignore
+0
-0
Chart.yaml
helm/hello-world-spring-boot/Chart.yaml
+1
-1
NOTES.txt
helm/hello-world-spring-boot/templates/NOTES.txt
+4
-4
_helpers.tpl
helm/hello-world-spring-boot/templates/_helpers.tpl
+10
-10
deployment.yaml
helm/hello-world-spring-boot/templates/deployment.yaml
+5
-5
hpa.yaml
helm/hello-world-spring-boot/templates/hpa.yaml
+3
-3
ingress.yaml
helm/hello-world-spring-boot/templates/ingress.yaml
+2
-2
service.yaml
helm/hello-world-spring-boot/templates/service.yaml
+3
-3
serviceaccount.yaml
helm/hello-world-spring-boot/templates/serviceaccount.yaml
+2
-2
test-connection.yaml
...lo-world-spring-boot/templates/tests/test-connection.yaml
+15
-0
values.yaml
helm/hello-world-spring-boot/values.yaml
+12
-8
No files found.
Dockerfile
View file @
d660c3aa
...
...
@@ -7,7 +7,7 @@
# actual container
FROM
amazoncorretto:11-alpine-jdk
COPY
target/
spring-boot-complete-0.0.1-SNAPSHOT.jar /usr/local/lib/hello-world.jar
COPY
spring-boot-complete-0.0.1-SNAPSHOT.jar /usr/local/lib/hello-world.jar
EXPOSE
8082
ENTRYPOINT
["java","-jar","/usr/local/lib/hello-world.jar"]
\ No newline at end of file
Jenkinsfile
View file @
d660c3aa
...
...
@@ -11,6 +11,7 @@ pipeline {
NEXUS_CREDENTIAL_ID
=
"jenkins-nexus"
REMOTE_AGENT
=
"34.74.120.53"
ARTIFACT_NAME
=
"spring-boot-complete-0.0.1-SNAPSHOT.jar"
IMAGE_NAME
=
"hello-world-spring-boot"
}
stages
{
stage
(
'Git Checkout'
)
{
...
...
@@ -66,7 +67,8 @@ pipeline {
scp target/${ARTIFACT_NAME} Dockerfile root@${REMOTE_AGENT}:/artifact
scp -r helm root@${REMOTE_AGENT}:/artifact
ssh root@${REMOTE_AGENT} "gcloud container clusters get-credentials jsteinberg-ascend-gke --region us-east1 --project jsteinberg-ascend && kubectl get pods -A"
ssh root@${REMOTE_AGENT} "docker build -t ${IMAGE_NAME}:latest /artifact"
ssh root@${REMOTE_AGENT} "helm uninstall ${IMAGE_NAME} || sleep 1; sleep 30; helm install ${IMAGE_NAME} /artifact/helm;"
'''
}
...
...
helm/hello-
spring
/.helmignore
→
helm/hello-
world-spring-boot
/.helmignore
View file @
d660c3aa
File moved
helm/hello-
spring
/Chart.yaml
→
helm/hello-
world-spring-boot
/Chart.yaml
View file @
d660c3aa
apiVersion
:
v2
name
:
hello-
spring
name
:
hello-
world-spring-boot
description
:
A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
...
...
helm/hello-
spring
/templates/NOTES.txt
→
helm/hello-
world-spring-boot
/templates/NOTES.txt
View file @
d660c3aa
...
...
@@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hello-
spring
.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hello-
world-spring-boot
.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hello-
spring
.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hello-
spring
.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hello-
world-spring-boot
.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hello-
world-spring-boot
.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hello-
spring
.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hello-
world-spring-boot
.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
...
...
helm/hello-
spring
/templates/_helpers.tpl
→
helm/hello-
world-spring-boot
/templates/_helpers.tpl
View file @
d660c3aa
{{
/*
Expand
the
name
of
the
chart
.
*/
}}
{{- define "hello-
spring
.name" -}}
{{- define "hello-
world-spring-boot
.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
...
...
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We
truncate
at
63
chars
because
some
Kubernetes
name
fields
are
limited
to
this
(
by
the
DNS
naming
spec
).
If
release
name
contains
chart
name
it
will
be
used
as
a
full
name
.
*/
}
}
{{- define "hello-
spring
.fullname" -}}
{{- define "hello-
world-spring-boot
.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
...
...
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{
{
/*
Create
chart
name
and
version
as
used
by
the
chart
label
.
*/
}
}
{{- define "hello-
spring
.chart" -}}
{{- define "hello-
world-spring-boot
.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{
{
/*
Common
labels
*/
}
}
{{- define "hello-
spring
.labels" -}}
helm.sh/chart: {{ include "hello-
spring
.chart" . }}
{{ include "hello-
spring
.selectorLabels" . }}
{{- define "hello-
world-spring-boot
.labels" -}}
helm.sh/chart: {{ include "hello-
world-spring-boot
.chart" . }}
{{ include "hello-
world-spring-boot
.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
...
...
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{
{
/*
Selector
labels
*/
}
}
{{- define "hello-
spring
.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hello-
spring
.name" . }}
{{- define "hello-
world-spring-boot
.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hello-
world-spring-boot
.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{
{
/*
Create
the
name
of
the
service
account
to
use
*/
}
}
{{- define "hello-
spring
.serviceAccountName" -}}
{{- define "hello-
world-spring-boot
.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hello-
spring
.fullname" .) .Values.serviceAccount.name }}
{{- default (include "hello-
world-spring-boot
.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
...
...
helm/hello-
spring
/templates/deployment.yaml
→
helm/hello-
world-spring-boot
/templates/deployment.yaml
View file @
d660c3aa
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
{{
include "hello-
spring
.fullname" .
}}
name
:
{{
include "hello-
world-spring-boot
.fullname" .
}}
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
spec
:
{{
- if not .Values.autoscaling.enabled
}}
replicas
:
{{
.Values.replicaCount
}}
{{
- end
}}
selector
:
matchLabels
:
{{
- include "hello-
spring
.selectorLabels" . | nindent 6
}}
{{
- include "hello-
world-spring-boot
.selectorLabels" . | nindent 6
}}
template
:
metadata
:
{{
- with .Values.podAnnotations
}}
...
...
@@ -18,13 +18,13 @@ spec:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
labels
:
{{
- include "hello-
spring
.selectorLabels" . | nindent 8
}}
{{
- include "hello-
world-spring-boot
.selectorLabels" . | nindent 8
}}
spec
:
{{
- with .Values.imagePullSecrets
}}
imagePullSecrets
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
serviceAccountName
:
{{
include "hello-
spring
.serviceAccountName" .
}}
serviceAccountName
:
{{
include "hello-
world-spring-boot
.serviceAccountName" .
}}
securityContext
:
{{
- toYaml .Values.podSecurityContext | nindent 8
}}
containers
:
...
...
helm/hello-
spring
/templates/hpa.yaml
→
helm/hello-
world-spring-boot
/templates/hpa.yaml
View file @
d660c3aa
...
...
@@ -2,14 +2,14 @@
apiVersion
:
autoscaling/v2beta1
kind
:
HorizontalPodAutoscaler
metadata
:
name
:
{{
include "hello-
spring
.fullname" .
}}
name
:
{{
include "hello-
world-spring-boot
.fullname" .
}}
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
spec
:
scaleTargetRef
:
apiVersion
:
apps/v1
kind
:
Deployment
name
:
{{
include "hello-
spring
.fullname" .
}}
name
:
{{
include "hello-
world-spring-boot
.fullname" .
}}
minReplicas
:
{{
.Values.autoscaling.minReplicas
}}
maxReplicas
:
{{
.Values.autoscaling.maxReplicas
}}
metrics
:
...
...
helm/hello-
spring
/templates/ingress.yaml
→
helm/hello-
world-spring-boot
/templates/ingress.yaml
View file @
d660c3aa
{{
- if .Values.ingress.enabled -
}}
{{
- $fullName
:
= include "hello-
spring
.fullname" . -
}}
{{
- $fullName
:
= include "hello-
world-spring-boot
.fullname" . -
}}
{{
- $svcPort
:
= .Values.service.port -
}}
{{
- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion))
}}
{{
- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class")
}}
...
...
@@ -17,7 +17,7 @@ kind: Ingress
metadata
:
name
:
{{
$fullName
}}
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
{{
- with .Values.ingress.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
...
...
helm/hello-
spring
/templates/service.yaml
→
helm/hello-
world-spring-boot
/templates/service.yaml
View file @
d660c3aa
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
include "hello-
spring
.fullname" .
}}
name
:
{{
include "hello-
world-spring-boot
.fullname" .
}}
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
spec
:
type
:
{{
.Values.service.type
}}
ports
:
...
...
@@ -12,4 +12,4 @@ spec:
protocol
:
TCP
name
:
http
selector
:
{{
- include "hello-
spring
.selectorLabels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.selectorLabels" . | nindent 4
}}
helm/hello-
spring
/templates/serviceaccount.yaml
→
helm/hello-
world-spring-boot
/templates/serviceaccount.yaml
View file @
d660c3aa
...
...
@@ -2,9 +2,9 @@
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
{{
include "hello-
spring
.serviceAccountName" .
}}
name
:
{{
include "hello-
world-spring-boot
.serviceAccountName" .
}}
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
{{
- with .Values.serviceAccount.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
...
...
helm/hello-
spring
/templates/tests/test-connection.yaml
→
helm/hello-
world-spring-boot
/templates/tests/test-connection.yaml
View file @
d660c3aa
apiVersion
:
v1
kind
:
Pod
metadata
:
name
:
"
{{
include
"hello-
spring
.fullname" . }}-test-connection"
name
:
"
{{
include
"hello-
world-spring-boot
.fullname" . }}-test-connection"
labels
:
{{
- include "hello-
spring
.labels" . | nindent 4
}}
{{
- include "hello-
world-spring-boot
.labels" . | nindent 4
}}
annotations
:
"
helm.sh/hook"
:
test
spec
:
...
...
@@ -11,5 +11,5 @@ spec:
-
name
:
wget
image
:
busybox
command
:
[
'
wget'
]
args
:
[
'
{{
include
"hello-
spring
.fullname"
.
}}:{{
.Values.service.port
}}'
]
args
:
[
'
{{
include
"hello-
world-spring-boot
.fullname"
.
}}:{{
.Values.service.port
}}'
]
restartPolicy
:
Never
helm/hello-
spring
/values.yaml
→
helm/hello-
world-spring-boot
/values.yaml
View file @
d660c3aa
# Default values for hello-
spring
.
# Default values for hello-
world-spring-boot
.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount
:
1
image
:
repository
:
nginx
pullPolicy
:
IfNotPresent
repository
:
hello-world-spring-boot
pullPolicy
:
Always
# Overrides the image tag whose default is the chart appVersion.
tag
:
"
"
...
...
@@ -25,10 +25,12 @@ serviceAccount:
podAnnotations
:
{}
podSecurityContext
:
{}
podSecurityContext
:
{}
# fsGroup: 2000
securityContext
:
{}
securityContext
:
{}
# capabilities:
# drop:
# - ALL
...
...
@@ -37,13 +39,14 @@ securityContext: {}
# runAsUser: 1000
service
:
type
:
ClusterIP
type
:
LoadBalancer
port
:
80
ingress
:
enabled
:
false
className
:
"
"
annotations
:
{}
annotations
:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts
:
...
...
@@ -56,7 +59,8 @@ ingress:
# hosts:
# - chart-example.local
resources
:
{}
resources
:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment