Skip to content

Commit 0310434

Browse files
committed
Remove the helm chart and associated scripts
The chart has now moved to the helm-charts repository with all the others to avoid duplicating the sources
1 parent a977d21 commit 0310434

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1
-4677
lines changed

.github/workflows/build_test_package.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -283,69 +283,3 @@ jobs:
283283
docker image tag com.cosmotech/cosmotech-api:${{github.sha}} \
284284
ghcr.io/cosmo-tech/cosmotech-api:latest
285285
docker image push ghcr.io/cosmo-tech/cosmotech-api:latest
286-
287-
288-
push_helm_charts_to_oci_registries:
289-
runs-on: ubuntu-latest
290-
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
291-
strategy:
292-
fail-fast: false
293-
matrix:
294-
include:
295-
- path: api/kubernetes/helm-chart
296-
chart_name: cosmotech-api-chart
297-
name: API
298-
needs:
299-
- unit_tests
300-
- integration_tests
301-
- controller_tests
302-
permissions:
303-
packages: write
304-
contents: read
305-
env:
306-
# OCI Support by Helm is considered experimental
307-
HELM_EXPERIMENTAL_OCI: 1
308-
309-
steps:
310-
- uses: actions/checkout@v4
311-
312-
- name: Set up Helm
313-
uses: azure/setup-helm@v4
314-
with:
315-
version: v3.6.0
316-
317-
- name: Retrieve branch or tag name
318-
id: refvar
319-
run: echo "::set-output name=gitRefName::${GITHUB_REF#refs/*/}"
320-
321-
- name: Login to GitHub Container Registry
322-
env:
323-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
324-
run: |
325-
echo "${GITHUB_TOKEN}" | \
326-
helm registry login ghcr.io \
327-
--username "${{ github.actor }}" \
328-
--password-stdin
329-
330-
- name: Push Helm Chart (sha) for ${{ matrix.name }} to GitHub Container Registry
331-
run: |
332-
helm dependency update ${{ matrix.path }}
333-
helm chart save ${{ matrix.path }} ghcr.io/cosmo-tech/${{ matrix.chart_name }}:${GITHUB_SHA}
334-
helm chart push ghcr.io/cosmo-tech/${{ matrix.chart_name }}:${GITHUB_SHA}
335-
336-
- name: Push Helm Chart (tag) for ${{ matrix.name }} to GitHub Container Registry
337-
if: startsWith(github.ref, 'refs/tags/')
338-
run: |
339-
helm chart save ${{ matrix.path }} ghcr.io/cosmo-tech/${{ matrix.chart_name }}:${{ steps.refvar.outputs.gitRefName }}
340-
helm chart push ghcr.io/cosmo-tech/${{ matrix.chart_name }}:${{ steps.refvar.outputs.gitRefName }}
341-
342-
- name: Push Helm Chart (latest) for ${{ matrix.name }} to GitHub Container Registry
343-
if: github.ref == 'refs/heads/main'
344-
run: |
345-
helm chart save ${{ matrix.path }} ghcr.io/cosmo-tech/${{ matrix.chart_name }}:latest
346-
helm chart push ghcr.io/cosmo-tech/${{ matrix.chart_name }}:latest
347-
348-
- name: Logout from GitHub Container Registry
349-
if: ${{ always() }}
350-
run: |
351-
helm registry logout ghcr.io || true

.github/workflows/doc.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,3 @@ jobs:
6464
fi
6565
env:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
68-
generate_and_push_doc_for_helm_charts:
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v4
72-
73-
- name: Update Helm Charts documentation
74-
run: ./scripts/kubernetes/update-helm-chart-readme.sh
75-
76-
- name: Set Git identity
77-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
78-
run: |
79-
git config --global user.email "[email protected]"
80-
git config --global user.name "$GITHUB_ACTOR"
81-
82-
- name: Push generated documentation if needed
83-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
84-
run: |
85-
git fetch --prune
86-
git pull --rebase --autostash
87-
if [[ `git status --porcelain` ]]; then
88-
git checkout -b helm_documentation
89-
git add api/kubernetes/*/README.md
90-
git commit -m "chore(docs): Update generated Helm Charts documentations" \
91-
-m "Co-authored-by: csmplatform <[email protected]>"
92-
git push --set-upstream origin helm_documentation
93-
gh pr create -B main -H helm_documentation --title 'Merge helm_documentation into main' --body 'Created by Github action'
94-
fi
95-
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -68,45 +68,3 @@ jobs:
6868
if: ${{ always() }}
6969
with:
7070
sarif_file: 'build/reports/detekt/sarif/'
71-
72-
helm-lint:
73-
runs-on: ubuntu-latest
74-
75-
steps:
76-
- uses: actions/checkout@v4
77-
78-
- name: Set up Helm
79-
uses: azure/setup-helm@v4
80-
with:
81-
version: v3.6.0
82-
83-
- name: Lint Helm Chart (api) with helm
84-
run: helm lint api/kubernetes/helm-chart
85-
86-
kube-linter:
87-
runs-on: ubuntu-latest
88-
strategy:
89-
matrix:
90-
chart:
91-
- helm-chart
92-
93-
steps:
94-
- uses: actions/checkout@v4
95-
96-
- run: mkdir -p api/kubernetes/.sarif
97-
98-
- name: Scan '${{ matrix.chart }}' Chart with kube-linter
99-
uses: stackrox/[email protected]
100-
with:
101-
directory: api/kubernetes/${{ matrix.chart }}
102-
config: api/kubernetes/.kube-linter.yaml
103-
format: sarif
104-
output-file: api/kubernetes/.sarif/${{ matrix.chart }}.sarif
105-
version: 0.2.5
106-
107-
- name: Upload SARIF file
108-
if: ${{ always() }}
109-
uses: github/codeql-action/upload-sarif@v3
110-
with:
111-
sarif_file: api/kubernetes/.sarif/${{ matrix.chart }}.sarif
112-

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,12 @@ out/
4444
# generated
4545
openapi/plantuml/.openapi-generator/
4646
openapi/openapi.yaml
47-
api/kubernetes/cronjob/*.yaml
4847

4948
### Personal directory ###
5049
perso
5150
config/application-dev*.properties
5251
config/application-*.yml
5352
!config/application-dev.sample.yml
54-
api/kubernetes/helm-chart/values-vcr.yaml
55-
/api/kubernetes/helm-chart/values-JREY*.yaml
5653

5754
### Logs ###
5855
logs/*access_log*.log
59-
60-
### Helm ###
61-
# Chart dependencies
62-
**/charts/*.tgz
63-
/kube-prometheus-stack.yaml
64-
/values-cosmotech-api-deploy.yaml

README.md

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -159,151 +159,13 @@ If you want to use a different context/cluster without changing your default set
159159
./gradlew :cosmotech-api:bootRun -PjvmArgs=-DuseKubernetesContext=<MY_CONTEXT>
160160
```
161161

162-
## Deploying
163-
164-
This project comes with a set of [Helm](https://helm.sh/) Charts to make it deployable to local or remote Kubernetes clusters.
165-
166-
### Prerequisites
167-
168-
- [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
169-
- [Helm](https://helm.sh/docs/intro/install/)
170-
171-
### Azure Kubernetes Service (AKS)
172-
173-
* Login against the container registry of your choice, like Azure Container Registries in the example below:
174-
175-
```shell
176-
az login
177-
az acr login --name csmenginesdev
178-
```
179-
180-
* Build and push the container image, e.g.:
181-
182-
```shell
183-
./gradlew :cosmotech-api:jib \
184-
-Djib.to.image=csmphoenixdev.azurecr.io/cosmotech-api:latest
185-
```
186-
187-
* Configure the cluster
188-
189-
This assumes you already retrieved the AKS cluster credentials, and configured your
190-
current `kubectl` context accordingly.
191-
192-
Otherwise, run `az aks get-credentials`, e.g.:
193-
194-
```shell
195-
az aks get-credentials \
196-
--resource-group phoenix \
197-
--name phoenixAKSdev
198-
```
199-
200-
* Run the deployment script
201-
202-
```
203-
./api/kubernetes/deploy_via_helm.sh --help
204-
205-
This script takes at least 4 parameters.
206-
207-
The following optional environment variables can be set to alter this script behavior:
208-
- ARGO_MINIO_REQUESTS_MEMORY | units of bytes (default is 4Gi) | Memory requests for the Argo MinIO server
209-
- NGINX_INGRESS_CONTROLLER_ENABLED | boolean (default is false) | indicating whether an NGINX Ingress Controller should be deployed and an Ingress resource created too
210-
- NGINX_INGRESS_CONTROLLER_REPLICA_COUNT | int (default is 1) | number of pods for the NGINX Ingress Controller
211-
- NGINX_INGRESS_CONTROLLER_LOADBALANCER_IP | IP Address String | optional public IP Address to use as LoadBalancer IP. You can create one with this Azure CLI command: az network public-ip create --resource-group <my-rg>> --name <a-name> --sku Standard --allocation-method static --query publicIp.ipAddress -o tsv
212-
- NGINX_INGRESS_CONTROLLER_HELM_ADDITIONAL_OPTIONS | Additional Helm options for the NGINX Ingress Controller | Additional options to pass to Helm when creating the Ingress Controller, e.g.: --set controller.service.annotations."service.beta.kubernetes.io/azure-load-balancer-resource-group"=my-azure-resource-group
213-
- CERT_MANAGER_ENABLED | boolean (default is false). Deprecated - use TLS_CERTIFICATE_TYPE instead | indicating whether cert-manager should be deployed. It is in charge of requesting and managing renewal of Let's Encrypt certificates
214-
- CERT_MANAGER_INSTALL_WAIT_TIMEOUT | string (default is 3m) | how much time to wait for the cert-manager Helm Chart to be successfully deployed
215-
- CERT_MANAGER_USE_ACME_PROD | boolean (default is false) | whether to use the Let's Encrypt Production server. Note that this is subject to rate limiting
216-
- CERT_MANAGER_COSMOTECH_API_DNS_NAME | FQDN String. Deprecated - use COSMOTECH_API_DNS_NAME instead | DNS name, used for Let's Encrypt certificate requests, e.g.: dev.api.cosmotech.com
217-
- COSMOTECH_API_DNS_NAME | FQDN String | DNS name, used for configuring the Ingress resource, e.g.: dev.api.cosmotech.com
218-
- CERT_MANAGER_ACME_CONTACT_EMAIL | Email String. Deprecated - use TLS_CERTIFICATE_LET_S_ENCRYPT_CONTACT_EMAIL instead | contact email, used for Let's Encrypt certificate requests
219-
- TLS_CERTIFICATE_TYPE | one of 'none', 'custom', 'let_s_encrypt' | strategy for TLS certificates
220-
- TLS_CERTIFICATE_LET_S_ENCRYPT_CONTACT_EMAIL | Email String | contact email, used for Let's Encrypt certificate requests
221-
- TLS_CERTIFICATE_CUSTOM_CERTIFICATE_PATH | File path | path to a file containing the custom TLS certificate to use for HTTPS
222-
- TLS_CERTIFICATE_CUSTOM_KEY_PATH | File path | path to a file containing the key for the custom TLS certificate to use for HTTPS
223-
224-
Usage: ./deploy_via_helm.sh CHART_PACKAGE_VERSION NAMESPACE ARGO_POSTGRESQL_PASSWORD API_VERSION [any additional options to pass as is to the cosmotech-api Helm Chart]
225-
226-
Examples:
227-
228-
- ./deploy_via_helm.sh latest phoenix "a-super-secret-password-for-postgresql" latest \
229-
--values /path/to/my/cosmotech-api-values.yaml \
230-
--set image.pullPolicy=Always
231-
232-
- ./deploy_via_helm.sh 1.0.1 phoenix "change-me" v1 --values /path/to/my/cosmotech-api-values.yaml
233-
```
234-
235-
You may want to use a dedicated `values.yaml` file instead, like below.
236-
Feel free to copy and customize this [values-azure.yaml](api/kubernetes/helm-chart/values-azure.yaml) file as needed.
237-
238-
```shell
239-
./api/kubernetes/deploy_via_helm.sh latest phoenix "a-secret" latest --values /path/to/my/values-azure-dev.yaml
240-
```
241-
242-
See the dedicated [README](api/kubernetes/helm-chart/README.md) for more details about the different properties.
243-
244-
### Local Kubernetes Cluster
245-
246-
* Spawn a local cluster. Skip if you already have configured a local cluster.
247-
248-
Otherwise, you may want to leverage the [scripts/kubernetes/create-local-k8s-cluster.sh](scripts/kubernetes/create-local-k8s-cluster.sh) script,
249-
which provisions a local [Kind](https://kind.sigs.k8s.io/) cluster, along with a private local container
250-
registry and an [NGINX Ingress Controller](https://kubernetes.github.io/ingress-nginx/).
251-
252-
To use it, simply [install Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation), and run the script, like so (`<cluster_name>` is optional and defaults to `local-k8s-cluster`):
253-
254-
```shell
255-
/bin/sh -c scripts/kubernetes/create-local-k8s-cluster.sh [<cluster_name>]
256-
```
257-
This creates a Kubernetes context named `kind-<cluster_name>`.
258-
259-
* Build and push the container image to the local registry, e.g.:
260-
261-
```shell
262-
./gradlew :cosmotech-api:jib \
263-
-Djib.allowInsecureRegistries=true \
264-
-Djib.to.image=localhost:5000/cosmotech-api:latest
265-
```
266-
267-
* Create the namespace if needed
268-
269-
```shell
270-
kubectl create namespace phoenix
271-
```
272-
273-
* Run the dev deployment script
274-
275-
**Example**
276-
277-
```
278-
./api/kubernetes/deploy_via_helm-dev.sh phoenix "a-super-secret-password" latest --values /path/to/my/values-dev.yaml
279-
```
280-
281-
This uses the default [values-dev.yaml](api/kubernetes/helm-chart/values-dev.yaml).
282-
283-
**Usage**
284-
285-
```
286-
❯ ./api/kubernetes/deploy_via_helm-dev.sh --help
287-
288-
This script takes at least 3 parameters.
289-
290-
The following optional environment variables can be set to alter this script behavior:
291-
- ARGO_MINIO_REQUESTS_MEMORY | units of bytes (default is 4Gi) | Memory requests for the Argo MinIO server
292-
293-
Usage: ./deploy_via_helm-dev.sh NAMESPACE ARGO_POSTGRESQL_PASSWORD API_VERSION [any additional options to pass as is to the cosmotech-api Helm Chart]
294-
295-
```
296-
297-
See the dedicated [README](api/kubernetes/helm-chart/README.md) for more details about the different properties.
298-
299162
## Contributing
300163

301164
Feel free to submit pull requests or open issues for bugs or feature requests.
302165

303166
We leverage the following tools to enforce code formatting and for code static analysis:
304167
- [Spotless](https://github.com/diffplug/spotless)
305168
- [Detekt](https://detekt.github.io/detekt/)
306-
- [KubeLinter](https://github.com/stackrox/kube-linter) and [helm lint](https://helm.sh/docs/helm/helm_lint/)
307169

308170
These checks are automatically enforced as part of the continuous integration runs on GitHub.
309171

@@ -345,19 +207,6 @@ To run a local analysis with Detekt, simply run the `detekt` Gradle task:
345207

346208
You will then find the reports for the different sub-projects in the `build/reports/detekt` folder, under different formats: Plain text, HTML, and [SARIF](https://sarifweb.azurewebsites.net/).
347209

348-
#### KubeLinter
349-
350-
To run a local analysis of the Helm Charts maintained in this repo:
351-
- install KubeLinter : https://github.com/stackrox/kube-linter#installing-kubelinter
352-
- Run KubeLinter against the 2 Charts:
353-
354-
```shell
355-
kube-linter --config api/kubernetes/.kube-linter.yaml lint api/kubernetes/helm-chart
356-
```
357-
358-
```shell
359-
kube-linter --config api/kubernetes/.kube-linter.yaml lint api/kubernetes/csm-argo
360-
```
361210

362211
#### Vulnerability report
363212

api/kubernetes/.kube-linter.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

api/kubernetes/charts/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)