{"id":23094863,"url":"https://github.com/lja9702/prometheus_grafana","last_synced_at":"2026-04-08T21:31:25.954Z","repository":{"id":124760006,"uuid":"239162124","full_name":"lja9702/prometheus_grafana","owner":"lja9702","description":"kubernetes상에서 prometheus와 grafana pod를 자동으로 배포해주는 모듈","archived":false,"fork":false,"pushed_at":"2020-04-28T12:28:15.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T19:25:51.818Z","etag":null,"topics":["auto","autodeployments","containers","docker","go","grafana","kubernetes","monitoring-tool","prometheus-grafana"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lja9702.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T16:16:32.000Z","updated_at":"2020-05-15T18:56:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf8d95b7-e15b-477f-8a5b-d14b613896af","html_url":"https://github.com/lja9702/prometheus_grafana","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/lja9702/prometheus_grafana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lja9702%2Fprometheus_grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lja9702%2Fprometheus_grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lja9702%2Fprometheus_grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lja9702%2Fprometheus_grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lja9702","download_url":"https://codeload.github.com/lja9702/prometheus_grafana/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lja9702%2Fprometheus_grafana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto","autodeployments","containers","docker","go","grafana","kubernetes","monitoring-tool","prometheus-grafana"],"created_at":"2024-12-16T22:18:28.129Z","updated_at":"2026-04-08T21:31:25.939Z","avatar_url":"https://github.com/lja9702.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus_grafana\nkubernetes상에서 prometheus와 grafana pod를 자동으로 배포해주는 모듈로\nservice, deployment, clusterRole, config map이 한번에 자동 배포되며,\ngrafana의 경우 prometheus와 연결될 수 있는 configMap.yaml을 사용하였습니다.\n\nJSON으로 namespace, nodeport, docker image version 등을 넘겨주어 자동 배포할 수 있습니다.\n\n# Getting Started\n- go version: 1.13\n- common.go: prometheus.go와 grafana.go에서 모두 사용하는 모듈을 모아놓은 파일\n- prometheus.go: prometheus배포를 위한 사용자정의 json 스펙 정의 및 배포를 위한 메인 모듈을 모아놓은 파일\n- grafana.go: grafana배포를 위한 사용자정의 json 스펙 정의 및 배포를 위한 메인 모듈을 모아놓은 파일\n\n- module 추가\n```\npg \"github.com/lja9702/prometheus_grafana\"\n```\n## prometheus 배포\n* JSON 형식\n```\ntype PrometheusSpec struct {\n\tNamespaceName string `json:\"namespaceName\"` //namespace 명 (default: monitoring)\n\tImgVersion    string `json:\"imgVersion\"`    //prometheus image version (default: latest)\n\tScrapeInterv  string `json:\"scrapeInterv\"`  //prometheus가 스크랩을 요청하는 시간 간격(default: 15s)\n\tNodePort   string `json:\"nodePort\"`   //(default: 30000)\n}\n```\n* 배포 모듈 사용\n```\nvar prometheusSpec = PrometheusSpec{  //예시\n    ScrapeInterv:  \"15s\",\n    NodePort:   \"30000\",\n    NamespaceName: \"monitoring123\",\n    ImgVersion:    \"v2.12.0\",\n}\n//custom yaml 파일을 만들기 위한 base yaml 파일 읽기\ngitPath := \"https://raw.githubusercontent.com/lja9702/prometheus_grafana/master/origin_yaml_list/\"\n//Prometheus pod 생성\npg.CreatePrometheus(prometheusSpec, gitPath)\n```\n## grafana 배포\n* JSON 형식\n```\ntype GrafanaSpec struct {\n\tNamespaceName  string `json:\"namespaceName\"`  //namespace 명 (default: monitoring)\n\tImgVersion     string `json:\"imgVersion\"`     //prometheus image version (default: latest)\n\tRequestsMemory string `json:\"requestsMemory\"` //request는 컨테이너가 생성될때 요청하는 리소스 양 (default: 1Gi)\n\tRequestsCpu   string `json:\"requestsCpu\"`    //default: 500m\n\tLimitsMemory   string `json:\"limitsMemory\"`   //리소스가 더 필요한 경우 추가로 더 사용할 수 있는 부분 (default: 2Gi)\n\tLimitsCpu      string `json:\"limitsCpu\"`      //default: 1000m\n\tNodePort\tstring `json:\"nodePort\"`\t//default: 32000\n}\n```\n* 배포 모듈 사용\n```\nvar grafanaSpec = GrafanaSpec{   //예시\n  \t\tNamespaceName:  \"monitoring123\",\n  \t\tImgVersion:     \"latest\",\n  \t\tRequestsMemory: \"1Gi\",\n  \t\tRequestsCpu:    \"500m\",\n  \t\tLimitsMemory:   \"2Gi\",\n  \t\tLimitsCpu:      \"1000m\",\n  \t\tNodePort:\t\"32000\",\n}\n\n//custom yaml 파일을 만들기 위한 base yaml 파일 읽기\ngitPath := \"https://raw.githubusercontent.com/lja9702/prometheus_grafana/master/origin_yaml_list/\"\n//Grafana pod 생성\npg.CreateGrafana(grafanaSpec, gitPath)\n```\n\n**참고: default라고 적힌 값은 진행한 프로젝트 frontend에서 지정한 임의의 값이며, 현 모듈에서는 적용되지 않습니다.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flja9702%2Fprometheus_grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flja9702%2Fprometheus_grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flja9702%2Fprometheus_grafana/lists"}