Skip to content

Commit

Permalink
Merge pull request #104 from hyun357123/main
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
hyun357123 authored Dec 3, 2024
2 parents d669da8 + 3a31a62 commit 0eda045
Show file tree
Hide file tree
Showing 132 changed files with 3,255 additions and 393 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Once the services are up, you can access the following endpoints:
- Repository UI : `http://<Public_IP>:8081`
- Application Manager UI: `http://<Public_IP>:18084/web`
- OSS Management: `http://<Public_IP>:18084/web/oss/list`
- Application Catalog Management: `http://<Public_IP>:18084/web/softwareCatalog/list`
- Application Catalog Management: `http://<Public_IP>:18084/web/softwareCatalog`
- Repository Management: `http://<Public_IP>:18084/web/repository/list`
- Yaml Generator: `http://<Public_IP>:18084/web/generate/yaml`

Expand Down
40 changes: 37 additions & 3 deletions applicationFE/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions bin/main/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spring:
generate-ddl: true
hibernate:
ddl-auto: ${DDL_AUTO:update} # ${DDL_AUTO:none}

# ddl-auto: create # 실행할 때에 테이블을 자동으로 생성시킬것인지 #create-drop, update, validate, none
# create : SessionFactory 시작시 스키마를 삭제하고 다시 생성
# create-drop : SessionFactory 종료 시 스키마를 삭제
Expand All @@ -39,7 +40,7 @@ spring:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
format_sql: true
show_sql: true
show_sql: false
hbm2ddl: # 처음에 더미데이터등을 넣기위해 sql을 실행
#import_files: ./data.sql # 확인필요
import_files:
Expand All @@ -65,14 +66,18 @@ aes:
key: fb1755281b0ca6184a0ee644e6477ee7

cbtumblebug:
url: 52.78.129.10
port: 1323
id: default
pass: default
url: ${TUMBLEBUG_URL:210.217.178.130}
port: ${TUMBLEBUG_PORT:1323}
id: ${TUMBLEBUG_ID:default}
pass: ${TUMBLEBUG_PASSWORD:default}

docker:
monitoring:
interval: 60000 # 밀리초 단위, 기본값은 60000 (1분)

file:
upload:
path:
windows: C:/mcmp/uploads/
linux: /home/mcmp/uploads/
allowed-extensions: jpg,jpeg,png,gif
allowed-extensions: jpg,jpeg,png,gif
413 changes: 319 additions & 94 deletions bin/main/import.sql

Large diffs are not rendered by default.

75 changes: 67 additions & 8 deletions bin/main/jenkins/kubernetes_helm_install_pipeline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>TUMBLEBUG_URI</name>
<name>CB_TUMBLEBUG_URI</name>
<description>Tumblebug API URL</description>
<defaultValue>http://52.78.129.10:1323/tumblebug</defaultValue>
<trim>true</trim>
Expand Down Expand Up @@ -38,9 +38,38 @@
<hudson.model.StringParameterDefinition>
<name>HELM_CHARTS</name>
<description>Helm Charts to Install (comma-separated)</description>
<defaultValue>nginx,grafana,prometheus,tomcat,redis</defaultValue>
<defaultValue>nginx,grafana,prometheus,tomcat,redis,mariadb</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.BooleanParameterDefinition>
<name>ENABLE_HPA</name>
<description>Enable Horizontal Pod Autoscaler</description>
<defaultValue>false</defaultValue>
</hudson.model.BooleanParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>HPA_MIN_REPLICAS</name>
<description>Minimum number of replicas for HPA</description>
<defaultValue>1</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>HPA_MAX_REPLICAS</name>
<description>Maximum number of replicas for HPA</description>
<defaultValue>10</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>HPA_CPU_UTILIZATION</name>
<description>Target CPU utilization percentage for HPA</description>
<defaultValue>80</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>HPA_MEMORY_UTILIZATION</name>
<description>Target Memory utilization percentage for HPA</description>
<defaultValue>80</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
Expand All @@ -64,8 +93,6 @@ pipeline {
}
stages {
stage('Check and Install kubectl and Helm') {
steps {
script {
Expand All @@ -92,7 +119,6 @@ pipeline {
'''
env.PATH = "${env.HOME}/bin:${env.PATH}"
env.HELM_INSTALLED = true
}
sh "helm version"
}
Expand Down Expand Up @@ -151,9 +177,10 @@ pipeline {
'grafana': "helm repo add grafana https://grafana.github.io/helm-charts && helm repo update && helm upgrade --install grafana-release grafana/grafana",
'prometheus': "helm repo add prometheus-community https://prometheus-community.github.io/helm-charts && helm repo update && helm upgrade --install prometheus-release prometheus-community/prometheus",
'tomcat': "helm upgrade --install tomcat-release oci://registry-1.docker.io/bitnamicharts/tomcat",
'redis': "helm upgrade --install redis-release oci://registry-1.docker.io/bitnamicharts/redis"
'redis': "helm upgrade --install redis-release oci://registry-1.docker.io/bitnamicharts/redis",
'mariadb': "helm repo add bitnami https://charts.bitnami.com/bitnami && helm repo update && helm upgrade --install mariadb-release bitnami/mariadb --set auth.rootPassword=rootpassword --set auth.database=mydb --set auth.username=myuser --set auth.password=mypassword"
]
def charts = params.HELM_CHARTS.split(',')
charts.each { chart ->
Expand Down Expand Up @@ -184,6 +211,35 @@ pipeline {
}
}
stage('Apply HPA') {
when {
expression { params.ENABLE_HPA == true }
}
steps {
script {
def charts = params.HELM_CHARTS.split(',')
charts.each { chart ->
chart = chart.trim()
def deploymentName = "${chart}-release"
echo "Applying HPA to ${deploymentName}"
try {
sh """
export KUBECONFIG=${WORKSPACE}/kubeconfig
kubectl autoscale deployment ${deploymentName} \
--min=${params.HPA_MIN_REPLICAS} \
--max=${params.HPA_MAX_REPLICAS} \
--cpu-percent=${params.HPA_CPU_UTILIZATION} \
--memory-percent=${params.HPA_MEMORY_UTILIZATION}
"""
echo "HPA applied to ${deploymentName} successfully"
} catch (Exception e) {
echo "Failed to apply HPA to ${deploymentName}: ${e.message}"
}
}
}
}
}
stage('Verify Installations') {
steps {
script {
Expand All @@ -192,6 +248,9 @@ pipeline {
export KUBECONFIG=${WORKSPACE}/kubeconfig
kubectl get pods,services --all-namespaces
helm list --all-namespaces
if (params.ENABLE_HPA) {
sh "kubectl get hpa --all-namespaces"
}
"""
} catch (Exception e) {
echo "Failed to verify installations: ${e.message}"
Expand All @@ -212,7 +271,7 @@ pipeline {
echo "Removed kubectl"
}
if (env.HELM_INSTALLED == 'true') {
sh "rm -f /usr/local/bin/helm"
sh "rm -f $HOME/bin/helm"
echo "Removed Helm"
}
}
Expand Down
Loading

0 comments on commit 0eda045

Please sign in to comment.