Skip to content

Commit

Permalink
Update base docker image to alpine (#22)
Browse files Browse the repository at this point in the history
* Update golang version

* Update base image for docker
  • Loading branch information
night-codes authored Oct 18, 2023
1 parent f95ad83 commit 4af54c1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@ RUN go mod verify

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOCACHE=/tmp/go-cache go build -buildvcs=false -o ./exporter .

FROM scratch
FROM alpine:latest

# Create non-root user
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
script

# Set the user for the final stage
USER script

COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=base /app/exporter .

# Since we're using scratch, there's no shell or user management. So, the process will run as the root user.
# However, since scratch doesn't contain any OS files, there's minimal risk.
CMD ["/exporter"]
2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Kubecost exporter helm chart for Kubernetes
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.4.0
version: 1.4.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 5 additions & 4 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cbi-oi-kubecost-exporter

![Version: 1.4.0](https://img.shields.io/badge/Version-1.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.4](https://img.shields.io/badge/AppVersion-1.4-informational?style=flat-square)
![Version: 1.4.1](https://img.shields.io/badge/Version-1.4.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.4](https://img.shields.io/badge/AppVersion-1.4-informational?style=flat-square)

### Kubecost exporter helm chart for Kubernetes

Expand Down Expand Up @@ -84,13 +84,13 @@ You should see 200/201s in the logs, which indicates that the exporter is workin
## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| --- | --- | --- | --- |
| cronSchedule | string | `"0 */6 * * *"` | Setting up a cronJob scheduler to run an export task at the right time |
| filePath | string | `"/var/kubecost"` | Filepath to mount persistent volume |
| fileRotation | bool | `true` | Delete files generated for the previous month (or the month before the previous month if INCLUDE_PREVIOUS_MONTH is set to true) |
| flexera.billConnectId | string | `"cbi-oi-kubecost-1"` | Bill Connect ID |
| flexera.orgId | string | `""` | Flexera Organization ID |
| flexera.refreshToken | string | `""` | Refresh Token from FlexeraOne You can provide the refresh token in two ways: 1. Directly as a string: refreshToken: "your_token_here" 2. Reference it from a Kubernetes secret: refreshToken: valueFrom: secretKeyRef: name: flexera-secrets # Name of the Kubernetes secret key: refresh_token # Key in the secret containing the refresh token |
| flexera.refreshToken | string | `""` | Refresh Token from FlexeraOne You can provide the refresh token in two ways: 1. Directly as a string: refreshToken: "your_token_here" 2. Reference it from a Kubernetes secret: refreshToken: valueFrom: secretKeyRef: name: flexera-secrets # Name of the Kubernetes secret key: refresh_token # Key in the secret containing the refresh token |
| flexera.shard | string | `"NAM"` | Shard ("NAM", "EU", "AU") |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"public.ecr.aws/flexera/cbi-oi-kubecost-exporter"` | |
Expand All @@ -108,5 +108,6 @@ You should see 200/201s in the logs, which indicates that the exporter is workin
| persistentVolume.enabled | bool | `true` | Enable Persistent Volume. If this setting is disabled, it may lead to inability to store history and data uploads older than 15 days in Flexera One |
| persistentVolume.size | string | `"1Gi"` | Persistent Volume size |

----------------------------------------------
---

Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
Binary file added helm-chart/cbi-oi-kubecost-exporter-1.4.1.tgz
Binary file not shown.
20 changes: 15 additions & 5 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ entries:
cbi-oi-kubecost-exporter:
- apiVersion: v2
appVersion: "1.4"
created: "2023-10-13T11:21:44.396278-06:00"
created: "2023-10-18T11:12:29.997449-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 0764874c5d940ff15cabc88315291598989514a5db1bf823ebedda2565577ade
name: cbi-oi-kubecost-exporter
type: application
urls:
- helm-chart/cbi-oi-kubecost-exporter-1.4.1.tgz
version: 1.4.1
- apiVersion: v2
appVersion: "1.4"
created: "2023-10-18T11:12:29.995999-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 671339fe2b3198825e11bad8203b080e896fc04bcdc4020738db2f121d4133e1
name: cbi-oi-kubecost-exporter
Expand All @@ -13,7 +23,7 @@ entries:
version: 1.4.0
- apiVersion: v2
appVersion: "1.3"
created: "2023-10-13T11:21:44.395125-06:00"
created: "2023-10-18T11:12:29.995263-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 0d967927bfab5f4bb6d40ce062710679e98b145c4b3f38709c0bf5d216ad8606
name: cbi-oi-kubecost-exporter
Expand All @@ -23,7 +33,7 @@ entries:
version: 1.3.0
- apiVersion: v2
appVersion: "1.2"
created: "2023-10-13T11:21:44.394041-06:00"
created: "2023-10-18T11:12:29.994336-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: d0c724c7bb085a1801e27f60ff748bc69aba14425cfd27fd132f99966692ed80
name: cbi-oi-kubecost-exporter
Expand All @@ -33,12 +43,12 @@ entries:
version: 1.2.0
- apiVersion: v2
appVersion: "1.1"
created: "2023-10-13T11:21:44.393271-06:00"
created: "2023-10-18T11:12:29.993962-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: c6f2681575b704b5934efea2357921896d55c4ad5e09692f31ab92b9e614cfea
name: cbi-oi-kubecost-exporter
type: application
urls:
- helm-chart/cbi-oi-kubecost-exporter-1.1.0.tgz
version: 1.1.0
generated: "2023-10-13T11:21:44.392264-06:00"
generated: "2023-10-18T11:12:29.993192-06:00"

0 comments on commit 4af54c1

Please sign in to comment.