From edbd1e848cf980a3d0093f95ba6a748f5824f479 Mon Sep 17 00:00:00 2001 From: Cassie Ying Date: Mon, 23 Jan 2023 16:32:24 +0000 Subject: [PATCH 1/2] add chart test and lint workflow Signed-off-by: Cassie Ying --- .github/workflows/lint-test.yaml | 43 +++++++++++++++++++ charts/cachenator/Chart.yaml | 2 +- .../tests/values.yaml => ci/test-values.yaml} | 6 ++- charts/cachenator/templates/deployment.yaml | 2 +- charts/cachenator/templates/vpa.yaml | 21 --------- charts/cachenator/values.yaml | 41 +++--------------- 6 files changed, 56 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/lint-test.yaml rename charts/cachenator/{templates/tests/values.yaml => ci/test-values.yaml} (93%) delete mode 100644 charts/cachenator/templates/vpa.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml new file mode 100644 index 0000000..7b87c58 --- /dev/null +++ b/.github/workflows/lint-test.yaml @@ -0,0 +1,43 @@ +name: Lint and Test Charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.3.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false + + - name: Create kind cluster + uses: helm/kind-action@v1.4.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install \ No newline at end of file diff --git a/charts/cachenator/Chart.yaml b/charts/cachenator/Chart.yaml index ac73c62..6b1e8b9 100644 --- a/charts/cachenator/Chart.yaml +++ b/charts/cachenator/Chart.yaml @@ -15,4 +15,4 @@ type: application # 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: 0.1.1 +version: 0.1.2 diff --git a/charts/cachenator/templates/tests/values.yaml b/charts/cachenator/ci/test-values.yaml similarity index 93% rename from charts/cachenator/templates/tests/values.yaml rename to charts/cachenator/ci/test-values.yaml index c482341..f788d12 100644 --- a/charts/cachenator/templates/tests/values.yaml +++ b/charts/cachenator/ci/test-values.yaml @@ -1,5 +1,5 @@ image: - registry: docker-ghcr-remote.abc.local + registry: ghcr.io image: marshallwace/cachenator tag: 0.19.1 @@ -45,4 +45,6 @@ volumes: items: - key: root-ca path: ca.crt -configs: {} \ No newline at end of file +configs: + root-ca: | + some cert here diff --git a/charts/cachenator/templates/deployment.yaml b/charts/cachenator/templates/deployment.yaml index 17b830c..dad0845 100644 --- a/charts/cachenator/templates/deployment.yaml +++ b/charts/cachenator/templates/deployment.yaml @@ -154,7 +154,7 @@ spec: - "-read-only" {{- end }} {{- if .Values.metrics.enabled }} - - "metrics-port={{ .Values.metrics.metrics_port }}" + - "-metrics-port={{ .Values.metrics.metrics_port }}" {{ else }} - "-disable-http-metrics" {{- end }} diff --git a/charts/cachenator/templates/vpa.yaml b/charts/cachenator/templates/vpa.yaml deleted file mode 100644 index 8f58242..0000000 --- a/charts/cachenator/templates/vpa.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{ if .Values.verticalPodAutoscaler }} -apiVersion: autoscaling.k8s.io/v1 -kind: VerticalPodAutoscaler -metadata: - name: {{ template "cachenator.name" . }} - labels: - # These are required so recommendations show up in [t/p]-vpa/ - creator: Fairwinds - source: goldilocks -spec: - targetRef: - apiVersion: "apps/v1" - kind: Deployment - name: {{ template "cachenator.name" . }} - updatePolicy: - updateMode: {{ required ".Values.verticalPodAutoscaler.updateMode required" .Values.verticalPodAutoscaler.updateMode | quote }} - {{- with .Values.verticalPodAutoscaler.containerPolicies }} - resourcePolicy: - containerPolicies: {{ toYaml . | nindent 6 }} - {{ end }} -{{ end }} \ No newline at end of file diff --git a/charts/cachenator/values.yaml b/charts/cachenator/values.yaml index 841399d..f18f028 100644 --- a/charts/cachenator/values.yaml +++ b/charts/cachenator/values.yaml @@ -1,7 +1,7 @@ image: - registry: https://marshallwace.github.io/ - image: cachenator - tag: 0.1.0 + registry: ghcr.io + image: marshallwace/cachenator + tag: 0.19.1 # Configures S3 proxy related settings s3: @@ -140,8 +140,8 @@ lifecycle: {} # # some script -#For additional side-containers: -#sidecars: +# For additional side-containers: +# sidecars: # - name: sidecar_name # image: docker-registry/image:tag # resources: @@ -185,37 +185,10 @@ resources: {} # cpu: 200m # memory: 1024Mi -verticalPodAutoscaler: - updateMode: "Off" - # Set custom updateMode per container (optional) - # containerPolicies: - # - containerName: my-sidecar - # mode: "Off" - # - containerName: other-sidecar - # mode: "Initial" - -# https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler -# updateMode can be: -# "Off" - Only recommends resource requests and limits -# "Initial" - Applies recommendations only at pod creation -# "Auto" - Automatically applies recommendations throughout the pod lifetime -verticalPodAutoscaler: - updateMode: "Off" - # Set custom updateMode per container (optional) - # containerPolicies: - # - containerName: my-sidecar - # mode: "Off" - # - containerName: other-sidecar - # mode: "Initial" - - - ################## #### Defaults #### ################## -# Applies to ingresses only -generateTLSCertificate: true # default for now, shouldn't have to change unless we deploy more issuers certIssuerName: vault-issuer @@ -236,6 +209,6 @@ podSecurityContext: {} # hostnames: # - "foo.local" -#imagePullPolicy: IfNotPresent +# imagePullPolicy: IfNotPresent -mutating_webhook_configuration: {} \ No newline at end of file +mutating_webhook_configuration: {} From 40adece3cfc0a8c0ad052543bfea79a79a67e98e Mon Sep 17 00:00:00 2001 From: Cassie Ying Date: Mon, 23 Jan 2023 16:51:08 +0000 Subject: [PATCH 2/2] add more instruction on AWS creds in readme Signed-off-by: Cassie Ying --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f0ead9..08b5a14 100644 --- a/README.md +++ b/README.md @@ -229,4 +229,7 @@ helm repo add gh_mwam https://marshallwace.github.io/cachenator/ helm repo update helm search repo cachenator helm pull gh_mwam/cachenator --version 0.1.0 -``` \ No newline at end of file +``` +If you are using custom S3 endpoint, in env vars, you will need to specific `AWS_REGION` and `AWS_CA_BUNDLE`. +You can pass in credentials using either (`AWS_SHARED_CREDENTIALS_FILE` and `AWS_PROFILE`) +or (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`)