diff --git a/alert/alertHandler.go b/alert/alertHandler.go index 296d83d..5fea3c9 100644 --- a/alert/alertHandler.go +++ b/alert/alertHandler.go @@ -3,13 +3,11 @@ package alert import ( "encoding/json" - //"flag" "fmt" "io/ioutil" "math/rand" "net/http" - //"path/filepath" "strconv" "time" @@ -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" ) @@ -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 @@ -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() } diff --git a/install_yaml/hc-api-server.yaml b/install_yaml/hc-api-server.yaml index 470d083..45e3398 100644 --- a/install_yaml/hc-api-server.yaml +++ b/install_yaml/hc-api-server.yaml @@ -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 @@ -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 @@ -70,4 +70,3 @@ spec: - name : config-module configMap: name : hc-version # configmap shoulde be already made before mount this - #serviceAccountName: hypercloud5-system-admin diff --git a/main.go b/main.go index b3f4edd..3e5f5de 100644 --- a/main.go +++ b/main.go @@ -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