зеркало из https://github.com/Azure/ARO-RP.git
Add healthcheck to Proxy
This commit is contained in:
Родитель
7a901cfa76
Коммит
c07ac36794
|
@ -7,11 +7,13 @@ ENV GOPATH=/root/go
|
|||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
RUN make proxy
|
||||
|
||||
FROM ${REGISTRY}/ubi8/ubi-minimal
|
||||
RUN microdnf update && microdnf clean all
|
||||
COPY --from=builder /go/src/github.com/Azure/ARO-RP/proxy /usr/local/bin/
|
||||
COPY --from=builder /app/proxy /usr/local/bin/
|
||||
ENTRYPOINT ["proxy"]
|
||||
EXPOSE 8443/tcp
|
||||
EXPOSE 8080/tcp
|
||||
USER 1000
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -29,7 +30,16 @@ type Server struct {
|
|||
subnet *net.IPNet
|
||||
}
|
||||
|
||||
func health(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
fmt.Fprintf(w, "Running.")
|
||||
}
|
||||
|
||||
func (s *Server) Run() error {
|
||||
healthMux := http.NewServeMux()
|
||||
healthMux.HandleFunc("/", health)
|
||||
go http.ListenAndServe(":8080", healthMux)
|
||||
|
||||
_, subnet, err := net.ParseCIDR(s.Subnet)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Загрузка…
Ссылка в новой задаче