Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tmax-cloud/hypercloud-api-server
Browse files Browse the repository at this point in the history
  • Loading branch information
dnxorjs1 committed Jan 20, 2021
2 parents 86d4819 + 9c5a5b2 commit 77245f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
42 changes: 19 additions & 23 deletions alert/alertHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ package alert
import (
"encoding/json"

//"flag"
"fmt"
"io/ioutil"
"math/rand"
"net/http"

//"path/filepath"
"strconv"
"time"

Expand All @@ -26,8 +24,6 @@ import (
"k8s.io/client-go/rest"
restclient "k8s.io/client-go/rest"

//"k8s.io/client-go/tools/clientcmd"
//"k8s.io/client-go/util/homedir"
"k8s.io/klog"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand All @@ -40,7 +36,7 @@ type alertClient struct {
}

func init() {
// var err error
var err error

// // If api-server on Process, active this code.
// // var kubeconfig2 *string
Expand All @@ -52,24 +48,24 @@ func init() {
// // flag.Parse()
// // config, err = clientcmd.BuildConfigFromFlags("", *kubeconfig2)

// // If api-server on Pod, active this code.
// config, err = restclient.InClusterConfig()
// if err != nil {
// panic(err.Error())
// }

// if err != nil {
// klog.Errorln(err)
// panic(err)
// }
// config.Burst = 100
// config.QPS = 100

// if err != nil {
// klog.Errorln(err)
// panic(err)
// }
// setScheme()
// If api-server on Pod, active this code.
config, err = restclient.InClusterConfig()
if err != nil {
panic(err.Error())
}

if err != nil {
klog.Errorln(err)
panic(err)
}
config.Burst = 100
config.QPS = 100

if err != nil {
klog.Errorln(err)
panic(err)
}
setScheme()

}

Expand Down
9 changes: 4 additions & 5 deletions install_yaml/hc-api-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ spec:
serviceAccount: hypercloud5-admin
containers:
- name: hypercloud5-api-server
image: 192.168.6.197:5000/hc-api-server:v0.1.0 #192.168.6.110:5000/hc-api-server:v0.0.3
imagePullPolicy: Always
image: 192.168.6.197:5000/hc-api-server:v0.1.1
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: Asia/Seoul
Expand All @@ -54,10 +54,10 @@ spec:
resources:
limits:
cpu: "1"
memory: "1Gi"
memory: "800M"
requests:
cpu: "1"
memory: "1Gi"
memory: "100M"
volumeMounts:
- name: api-server-log-mnt
mountPath: /logs
Expand All @@ -70,4 +70,3 @@ spec:
- name : config-module
configMap:
name : hc-version # configmap shoulde be already made before mount this
#serviceAccountName: hypercloud5-system-admin
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func main() {
mux.HandleFunc("/api/hypercloud/user", serveUser)
mux.HandleFunc("/api/hypercloud/metering", serveMetering)
mux.HandleFunc("/api/hypercloud/namespace", serveNamespace)
// mux.HandleFunc("/api/hypercloud/alert", serveAlert)
mux.HandleFunc("/namespaceClaim", serveNamespaceClaim)
mux.HandleFunc("/version", serveVersion)
mux.HandleFunc("/api/hypercloud/alert", serveAlert)
mux.HandleFunc("/api/hypercloud/namespaceClaim", serveNamespaceClaim)
mux.HandleFunc("/api/hypercloud/version", serveVersion)

if hcMode != "single" {
// for multi mode only
Expand Down

0 comments on commit 77245f8

Please sign in to comment.