Skip to content

Commit

Permalink
CON-26727_compatible_with_ocean_ctrlv1
Browse files Browse the repository at this point in the history
  • Loading branch information
yehielnetapp authored Jun 5, 2024
1 parent 00af2ed commit c0aa61f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/ocean-network-client/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers:
# 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.0.22
version: 1.0.23

# 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
13 changes: 7 additions & 6 deletions charts/ocean-network-client/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ocean-network-client

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

A Helm chart for Ocean Network Client.

Expand Down Expand Up @@ -30,17 +30,18 @@ helm install my-release spot/ocean-network-client

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| configMapName | Optional | `"spotinst-kubernetes-cluster-controller-config"` | ConfigMap name. |
| image.pullPolicy | Optional | `"IfNotPresent"` | Image pull policy. |
| image.pullSecrets | Optional | `[]` | Image pull secrets. |
| image.repository | Optional | `"public.ecr.aws/spotinst/spot-network-client"` | Image repository. |
| image.tag | Optional | `""` | Image tag. Defaults to `.Chart.AppVersion`. |
| namespace | Optional | `"kube-system"` | Namespace where components should be installed. |
| oceanController.configMapName | Optional | `"spotinst-kubernetes-cluster-config"` | ConfigMap name. |
| oceanController.secretName | Optional | `"spotinst-kubernetes-cluster"` | Secret name. |
| oceanInfoData | Optional | `"spotinst-ocean-cluster"` | ConfigMap name. |
| resources | Optional | `{"requests":{"cpu":"30m","memory":"150Mi"}}` | Resource requests and limits. Ref: http://kubernetes.io/docs/user-guide/compute-resources/ |
| spotinst.account | string | `""` | Spot Account. (Required) Ref: https://docs.spot.io/administration/organizations?id=account |
| spotinst.clusterIdentifier | string | `""` | Unique identifier used by the Ocean Controller to connect (Required) between the Ocean backend and the Kubernetes cluster. Ref: https://docs.spot.io/ocean/tutorials/spot-kubernetes-controller/ |
| spotinst.token | string | `""` | Spot Token. (Required) Ref: https://docs.spot.io/administration/api/create-api-token |
| secretName | Optional | `"spotinst-kubernetes-cluster-controller"` | Secret name. |
| spotinst.account | Optional | `""` | Spot Account. Ref: https://docs.spot.io/administration/organizations?id=account |
| spotinst.clusterIdentifier | Optional | `""` | Unique identifier used by the Ocean Controller to connect between the Ocean backend and the Kubernetes cluster. Ref: https://docs.spot.io/ocean/tutorials/spot-kubernetes-controller/ |
| spotinst.token | Optional | `""` | Spot Token. Ref: https://docs.spot.io/administration/api/create-api-token |
| tolerations | Optional | `[{"operator":"Exists"}]` | Tolerations - Enable pods to run an all nodes in cluster Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |

----------------------------------------------
Expand Down
16 changes: 12 additions & 4 deletions charts/ocean-network-client/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ Namespace.
ConfigMap name.
*/}}
{{- define "ocean-network-client.configMapName" -}}
{{ default (include "ocean-network-client.name" .) .Values.oceanController.configMapName }}
{{- end }}
{{- if ne .Values.spotinst.clusterIdentifier "" -}}
{{- .Values.oceanInfoData -}}
{{- else -}}
{{- default (include "ocean-network-client.name" .) .Values.configMapName -}}
{{- end -}}
{{- end -}}

{{/*
Secret name.
*/}}
{{- define "ocean-network-client.secretName" -}}
{{ default (include "ocean-network-client.name" .) .Values.oceanController.secretName }}
{{- end }}
{{- if ne .Values.spotinst.account "" -}}
{{- .Values.oceanInfoData -}}
{{- else -}}
{{ default (include "ocean-network-client.name" .) .Values.secretName }}
{{- end -}}
{{- end -}}

{{/*
DaemonSet labels.
Expand Down
4 changes: 3 additions & 1 deletion charts/ocean-network-client/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{ if ne .Values.spotinst.clusterIdentifier "" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "ocean-network-client.configMapName" . }}
namespace: {{ include "ocean-network-client.namespace" . }}
data:
spotinst.cluster-identifier: {{ required "`spotinst.clusterIdentifier` must be specified" .Values.spotinst.clusterIdentifier }}
spotinst.cluster-identifier: {{ .Values.spotinst.clusterIdentifier }}
{{- end }}
1 change: 0 additions & 1 deletion charts/ocean-network-client/templates/daemon_set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ spec:
configMapKeyRef:
name: {{ include "ocean-network-client.configMapName" . }}
key: spotinst.cluster-identifier
optional: true
- name: MY_POD_IP
valueFrom:
fieldRef:
Expand Down
7 changes: 4 additions & 3 deletions charts/ocean-network-client/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{ if ne .Values.spotinst.account "" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "ocean-network-client.secretName" . }}
namespace: {{ include "ocean-network-client.namespace" . }}
type: Opaque
data:
token: {{ required "`spotinst.token` must be specified" .Values.spotinst.token | b64enc }}
account: {{ required "`spotinst.account` must be specified" .Values.spotinst.account | b64enc }}

token: {{ .Values.spotinst.token | b64enc }}
account: {{ .Values.spotinst.account | b64enc }}
{{- end }}
18 changes: 10 additions & 8 deletions charts/ocean-network-client/values.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# -- (Optional) Namespace where components should be installed.
namespace: kube-system

oceanController:
# -- (Optional) Secret name.
secretName: spotinst-kubernetes-cluster
# -- (Optional) ConfigMap name.
configMapName: spotinst-kubernetes-cluster-config
# -- (Optional) Secret name.
secretName: spotinst-kubernetes-cluster-controller
# -- (Optional) ConfigMap name.
configMapName: spotinst-kubernetes-cluster-controller-config

# -- (Optional) ConfigMap name.
oceanInfoData: spotinst-ocean-cluster

# Spot Configuration.
spotinst:
# -- Spot Token. (Required)
# -- (Optional) Spot Token.
# Ref: https://docs.spot.io/administration/api/create-api-token
token: ""
# -- Spot Account. (Required)
# -- (Optional) Spot Account.
# Ref: https://docs.spot.io/administration/organizations?id=account
account: ""
# -- Unique identifier used by the Ocean Controller to connect (Required)
# -- (Optional) Unique identifier used by the Ocean Controller to connect
# between the Ocean backend and the Kubernetes cluster.
# Ref: https://docs.spot.io/ocean/tutorials/spot-kubernetes-controller/
clusterIdentifier: ""
Expand Down

0 comments on commit c0aa61f

Please sign in to comment.