Explorar el Código

Merge branch 'develop' into allow-readonly-root-filesytem

Signed-off-by: Kai Timmer <kai@staffbase.com>
Kai Timmer hace 2 años
padre
commit
ffd6c44d89

+ 31 - 0
CONTRIBUTING.md

@@ -117,3 +117,34 @@ Please write a commit message with Fixes Issue # if there is an outstanding issu
 Please run `go fmt` on the project directory. Lint can be okay (for example, comments on exported functions are nice but not required on the server).
 
 Please reach us on [CNCF Slack](https://slack.cncf.io/) in the [#opencost](https://cloud-native.slack.com/archives/C03D56FPD4G) channel or attend the biweekly [OpenCost Working Group community meeting](https://bit.ly/opencost-meeting) from the [Community Calendar](https://bit.ly/opencost-calendar) to discuss OpenCost development.
+
+## Third Party Attributions
+
+The THIRD_PARTY_LICENSES.txt file should contain the up-to-date license, copyright, and notice information for dependencies used by Opencost.
+When adding, updating, or removing dependencies, please update the associate section(s) of the [THIRD_PARTY_LICENSES.txt](THIRD_PARTY_LICENSES.txt) file. 
+
+For example, the `github.com/opencost/opencost/core` dependency contains the following third party attributions.
+The license associated with the SPDX identifier should also be included in the attributions file, if it is not already present.
+
+```
+== Dependency
+github.com/opencost/opencost/core
+
+== License Type
+SPDX:Apache-2.0
+
+== Copyright
+Copyright 2019 - 2022 Stackwatch Incorporated. All Rights Reserved.
+Copyright 2022 - 2024 Cloud Native Computing Foundation
+
+== Notices
+OpenCost
+Copyright 2022 - 2024 Cloud Native Computing Foundation
+
+This product includes software developed at
+The Cloud Native Computing Foundation (http://www.cncf.io).
+
+The Initial Developer of some parts of the specification and project is
+Kubecost (http://www.kubecost.com).
+Copyright 2019 - 2022 Stackwatch Incorporated. All Rights Reserved.
+```

+ 1 - 0
Dockerfile

@@ -43,6 +43,7 @@ LABEL org.opencontainers.image.url=https://github.com/opencost/opencost
 
 RUN apk add --update --no-cache ca-certificates
 COPY --from=build-env /go/bin/app /go/bin/app
+ADD --chmod=644 ./THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
 ADD --chmod=644 ./configs/default.json /models/default.json
 ADD --chmod=644 ./configs/azure.json /models/azure.json
 ADD --chmod=644 ./configs/aws.json /models/aws.json

+ 1 - 0
Dockerfile.cross

@@ -13,6 +13,7 @@ ARG binarypath
 
 RUN apk add --update --no-cache ca-certificates
 
+ADD --chmod=644 ./THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
 ADD --chmod=644 ./configs/default.json /models/default.json
 ADD --chmod=644 ./configs/azure.json /models/azure.json
 ADD --chmod=644 ./configs/aws.json /models/aws.json

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 7229 - 0
THIRD_PARTY_LICENSES.txt


+ 2 - 2
kubernetes/exporter/opencost-exporter.yaml

@@ -150,7 +150,7 @@ spec:
               memory: "1G"
           env:
             - name: PROMETHEUS_SERVER_ENDPOINT
-              value: "http://my-prometheus-server.prometheus.svc" # The endpoint should have the form http://<service-name>.<namespace-name>.svc
+              value: "http://prometheus-server.prometheus-system.svc" # The endpoint should have the form http://<service-name>.<namespace-name>.svc
             - name: CLOUD_PROVIDER_API_KEY
               value: "AIzaSyD29bGxmHAVEOBYtgd8sYM2gM2ekfxQX4U" # The GCP Pricing API requires a key. This is supplied just for evaluation.
             - name: CLUSTER_ID
@@ -189,4 +189,4 @@ spec:
     - name: opencost
       port: 9003
       targetPort: 9003
----
+---

+ 1 - 1
kubernetes/opencost.yaml

@@ -153,7 +153,7 @@ spec:
               memory: "1G"
           env:
             - name: PROMETHEUS_SERVER_ENDPOINT
-              value: "http://my-prometheus-server.prometheus.svc" # The endpoint should have the form http://<service-name>.<namespace-name>.svc
+              value: "http://prometheus-server.prometheus-system.svc" # The endpoint should have the form http://<service-name>.<namespace-name>.svc
             - name: CLOUD_PROVIDER_API_KEY
               value: "AIzaSyD29bGxmHAVEOBYtgd8sYM2gM2ekfxQX4U" # The GCP Pricing API requires a key. This is supplied just for evaluation.
             - name: CLUSTER_ID

+ 4 - 0
ui/Dockerfile

@@ -25,6 +25,10 @@ ENV UI_PORT=9090
 
 COPY --from=builder /opt/ui/dist /opt/ui/dist
 RUN mkdir -p /var/www
+
+COPY THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
+COPY --from=builder /opt/ui/dist /var/www
+
 COPY default.nginx.conf.template /etc/nginx/conf.d/default.nginx.conf.template
 COPY nginx.conf /etc/nginx/
 COPY ./docker-entrypoint.sh /usr/local/bin/

+ 1 - 0
ui/Dockerfile.cross

@@ -17,6 +17,7 @@ ENV API_SERVER=0.0.0.0
 ENV UI_PORT=9090
 
 COPY ./dist /opt/ui/dist
+COPY THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
 COPY default.nginx.conf.template /etc/nginx/conf.d/default.nginx.conf.template
 COPY nginx.conf /etc/nginx/
 COPY ./docker-entrypoint.sh /usr/local/bin/

+ 2 - 2
ui/README.md

@@ -5,8 +5,8 @@
 See https://www.opencost.io/docs/install for the full instructions.
 
 ```
-helm install my-prometheus --repo https://prometheus-community.github.io/helm-charts prometheus \
-  --namespace prometheus --create-namespace \
+helm install prometheus --repo https://prometheus-community.github.io/helm-charts prometheus \
+  --namespace prometheus-system --create-namespace \
   --set pushgateway.enabled=false \
   --set alertmanager.enabled=false \
   -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/prometheus/extraScrapeConfigs.yaml

+ 5 - 0
ui/justfile

@@ -1,5 +1,6 @@
 version := `../tools/image-tag`
 commit := `git rev-parse --short HEAD`
+thirdPartyLicenseFile := "THIRD_PARTY_LICENSES.txt"
 
 default:
     just --list
@@ -10,6 +11,7 @@ build-local:
     npx parcel build src/index.html
 
 build IMAGETAG: build-local
+    cp ../{{thirdPartyLicenseFile}} .
     docker buildx build \
         --rm \
         --platform "linux/amd64" \
@@ -36,3 +38,6 @@ build IMAGETAG: build-local
         --platforms "linux/amd64,linux/arm64" \
         --template {{IMAGETAG}}-ARCH \
         --target {{IMAGETAG}}
+
+    rm -f {{thirdPartyLicenseFile}}
+

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio