Skip to content

Commit

Permalink
chore: 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
Seungpang committed Jun 11, 2024
1 parent 68b2088 commit d16c72e
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 10 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/click-service-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ env:
DATASOURCE_URL: ${{secrets.DB_URL}}
DATASOURCE_USERNAME: ${{secrets.DB_USERNAME}}
DATASOURCE_PASSWORD: ${{secrets.DB_PASSWORD}}
GRAFANA_ADMIN_USER: ${{ secrets.GRAFANA_ADMIN_USER }}
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}

jobs:
build:
Expand Down Expand Up @@ -52,8 +54,8 @@ jobs:
- id: 'get-credentials'
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: autopilot-cluster-1
location: ${{ env.REGION }}
cluster_name: cluster-1
location: ${{ env.REGION }}-a

- name: Docker auth
run: |-
Expand All @@ -79,3 +81,26 @@ jobs:
kubectl apply -f ./deployment.yaml
kubectl apply -f ./click-service/hpa.yaml
# - name: Create monitoring namespace
# run: |
# kubectl create namespace monitoring || true
#
# - name: Create or Update Grafana secrets
# run: |
# kubectl delete secret grafana-secrets --namespace monitoring || true
# kubectl create secret generic grafana-secrets --from-literal=admin-user=${{ secrets.GRAFANA_ADMIN_USER }} --from-literal=admin-password=${{ secrets.GRAFANA_ADMIN_PASSWORD }} --namespace monitoring
#
# - name: Deploy Grafana
# run: |
# helm repo add grafana https://grafana.github.io/helm-charts
# helm repo update
# helm upgrade --install grafana grafana/grafana --values ./click-service/grafana-values.yaml --namespace monitoring
#
# - name: Deploy Loki
# run: |
# helm upgrade --install loki grafana/loki-stack --values ./click-service/loki-values.yaml --namespace monitoring --create-namespace
#
# - name: Deploy Promtail
# run: |
# helm upgrade --install promtail grafana/promtail --values ./click-service/promtail-values.yaml --namespace monitoring

2 changes: 1 addition & 1 deletion .github/workflows/click-service-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI-click-service

on:
pull_request:
push:
branches: [ main ]
paths:
- click-service/**
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/transfer-service-cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cd for transfer-service
on:
pull_request:
push:
branches: [ main ]
paths:
- transfer-service/**
Expand Down Expand Up @@ -53,8 +53,8 @@ jobs:
- id: 'get-credentials'
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: autopilot-cluster-1
location: ${{ env.REGION }}
cluster_name: cluster-1
location: ${{ env.REGION }}-a

- name: Docker auth
run: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/transfer-service-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI-transfer-service

on:
pull_request:
push:
branches: [ main ]
paths:
- transfer-service/**
Expand Down
2 changes: 1 addition & 1 deletion click-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jib {
image = "eclipse-temurin:17-jre-alpine@sha256:635ec1b177ac2a587324ed5eda2b9dec197876e16d10c35a4ef9595d76c2c891"
}
to {
image = "asia-northeast3-docker.pkg.dev/ninth-victor-422606-e1/clickme/click-service:latest"
image = "asia-northeast3-docker.pkg.dev/custom-unison-426015-r7/clickme/click-service:latest"
}
container {
jvmFlags = ["-Xms258m", "-Xmx1024m"]
Expand Down
15 changes: 15 additions & 0 deletions click-service/grafana-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
service:
type: LoadBalancer
admin:
existingSecret: grafana-secrets
userKey: admin-user
passwordKey: admin-password
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.monitoring.svc.cluster.local
access: proxy
isDefault: true
42 changes: 42 additions & 0 deletions click-service/loki-value.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
loki:
config:
auth_enabled: false
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
max_transfer_retries: 0
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /var/loki/index
cache_location: /var/loki/cache
cache_ttl: 24h
filesystem:
directory: /var/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
persistence:
enabled: true
storageClassName: standard
accessModes:
- ReadWriteOnce
size: 10Gi
7 changes: 7 additions & 0 deletions click-service/prometheus-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
server:
service:
type: ClusterIP
alertmanager:
enabled: true
service:
type: ClusterIP
22 changes: 22 additions & 0 deletions click-service/promtail-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
config:
server:
http_listen_port: 9080
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki.monitoring.svc.cluster.local:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/*log
- job_name: click-service
static_configs:
- targets:
- localhost
labels:
job: click-service
__path__: /var/log/click-service/*.log
2 changes: 1 addition & 1 deletion click-service/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: click-service
spec:
replicas: 3
replicas: 1
selector:
matchLabels:
app: click-service
Expand Down
2 changes: 1 addition & 1 deletion transfer-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jib {
image = "eclipse-temurin:17-jre-alpine@sha256:635ec1b177ac2a587324ed5eda2b9dec197876e16d10c35a4ef9595d76c2c891"
}
to {
image = "asia-northeast3-docker.pkg.dev/ninth-victor-422606-e1/clickme/transfer-service:latest"
image = "asia-northeast3-docker.pkg.dev/custom-unison-426015-r7/clickme/transfer-service:latest"
}
container {
jvmFlags = ["-Xms258m", "-Xmx1024m"]
Expand Down

0 comments on commit d16c72e

Please sign in to comment.