Skip to content

Commit

Permalink
Add spotnet network client chart
Browse files Browse the repository at this point in the history
Add spotnet network client chart
  • Loading branch information
avitalwerz authored Aug 29, 2022
2 parents 708de91 + 0be0624 commit 4ff0eb8
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/ocean-network-client/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
26 changes: 26 additions & 0 deletions charts/ocean-network-client/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v2
name: spotinst-ocean-network-client
description: A Helm chart for Ocean Network Client
type: application
home: https://github.com/spotinst/charts/tree/main/charts/ocean-network-client
icon: https://docs.spot.io/_media/images/spot_mark.png
sources:
- https://github.com/spotinst/spot-network-client
keywords:
- spot
- ocean
- network
maintainers:
- name: spotinst
email: ng-spot-info@netapp.com

# 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.0

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0-8-lb_endpoint-d0ec127"
42 changes: 42 additions & 0 deletions charts/ocean-network-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ocean-network-client

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

A Helm chart for Ocean Network Client.

## Installation

1. Add the Spot Helm chart repository:

```sh
helm repo add spot https://charts.spot.io
```

2. Update your local Helm chart repository cache:

```sh
helm repo update
```

3. Install `ocean-network-client`:

```sh
helm install my-release spot/ocean-network-client
```

> NOTE: Please configure all required chart values using the `set` command line argument or a `values.yaml` file.
## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| namespace | string | `"kube-system"` | (Optional) Namespace where components should be installed. |
| image.repository | string | `"public.ecr.aws/spotinst/spot-network-client"` | (Optional) Image repository. |
| image.tag | string | `""` | (Optional) Image tag. Defaults to `.Chart.AppVersion`. |
| image.pullPolicy | string | `"Always"` | (Optional) Image pull policy. |
| resources | object | `{"limits":{"cpu":"300m","memory":"500Mi"},"requests":{"cpu":"10m","memory":"150Mi"}}` | (Optional) Resource requests and limits. Ref: http://kubernetes.io/docs/user-guide/compute-resources/ |
| oceanController.configMapName | string | `"spotinst-kubernetes-cluster-controller-config"` | (Optional) ConfigMap name. |
| oceanController.secretName | string | `"spotinst-kubernetes-cluster-controller"` | (Optional) Secret name. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0)
41 changes: 41 additions & 0 deletions charts/ocean-network-client/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "ocean-network-client.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Namespace.
*/}}
{{- define "ocean-network-client.namespace" -}}
{{ default (include "ocean-network-client.name" .) .Values.namespace }}
{{- end }}

{{/*
ConfigMap name.
*/}}
{{- define "ocean-network-client.configMapName" -}}
{{ default (include "ocean-network-client.name" .) .Values.oceanController.configMapName }}
{{- end }}

{{/*
Secret name.
*/}}
{{- define "ocean-network-client.secretName" -}}
{{ default (include "ocean-network-client.name" .) .Values.oceanController.secretName }}
{{- end }}

{{/*
DaemonSet labels.
*/}}
{{- define "ocean-network-client.daemon-set.labels" -}}
app: ocean-network-client
{{- end }}

{{/*
NodeSelector labels.
*/}}
{{- define "ocean-network-client.node-selector.labels" -}}
kubernetes.io/os: linux
{{- end }}
11 changes: 11 additions & 0 deletions charts/ocean-network-client/templates/cluster_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "ocean-network-client.name" . }}
rules:
# ----------------------------------------------------------------------------
# Required for functional operation (read-only).
# ----------------------------------------------------------------------------
- apiGroups: [""]
resources: ["pods", "nodes"]
verbs: ["get", "list", "watch"]
12 changes: 12 additions & 0 deletions charts/ocean-network-client/templates/cluster_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "ocean-network-client.name" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "ocean-network-client.name" . }}
subjects:
- kind: ServiceAccount
name: {{ include "ocean-network-client.name" . }}
namespace: {{ include "ocean-network-client.namespace" . }}
74 changes: 74 additions & 0 deletions charts/ocean-network-client/templates/daemon_set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "ocean-network-client.name" . }}
namespace: {{ include "ocean-network-client.namespace" . }}
spec:
selector:
matchLabels:
{{- include "ocean-network-client.daemon-set.labels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ocean-network-client.daemon-set.labels" . | nindent 8 }}
spec:
hostNetwork: true
nodeSelector:
{{- include "ocean-network-client.node-selector.labels" . | nindent 8 }}
volumes:
- name: varlog
hostPath:
path: /var/log
serviceAccountName: {{ include "ocean-network-client.name" . }}
terminationGracePeriodSeconds: 30
containers:
- name: {{ include "ocean-network-client.name" . }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
securityContext:
privileged: true
capabilities:
drop: ["all"]
add: [ "NET_ADMIN", "SYS_ADMIN"] # bpf need SYS_ADMIN network netlink need NET_ADMIN
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: varlog
mountPath: /var/log
env:
- name: REPORT_INTERVAL
value: "60"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: SPOTINST_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "ocean-network-client.secretName" . }}
key: token
optional: true
- name: SPOTINST_ACCOUNT
valueFrom:
secretKeyRef:
name: {{ include "ocean-network-client.secretName" . }}
key: account
optional: true
- name: SPOTINST_TOKEN_LEGACY
valueFrom:
configMapKeyRef:
name: {{ include "ocean-network-client.configMapName" . }}
key: spotinst.token
optional: true
- name: SPOTINST_ACCOUNT_LEGACY
valueFrom:
configMapKeyRef:
name: {{ include "ocean-network-client.configMapName" . }}
key: spotinst.account
optional: true
- name: CLUSTER_IDENTIFIER
valueFrom:
configMapKeyRef:
name: {{ include "ocean-network-client.configMapName" . }}
key: spotinst.cluster-identifier
optional: true
5 changes: 5 additions & 0 deletions charts/ocean-network-client/templates/service_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: {{ include "ocean-network-client.name" . }}
namespace: {{ include "ocean-network-client.namespace" . }}
26 changes: 26 additions & 0 deletions charts/ocean-network-client/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ocean-network-client
namespace: kube-system

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

image:
# -- (Optional) Image repository.
repository: public.ecr.aws/spotinst/spot-network-client
# -- (Optional) Image pull policy.
pullPolicy: Always
# -- (Optional) Image tag. Defaults to `.Chart.AppVersion`.
tag: ""

# -- (Optional) Resource requests and limits.
# Ref: http://kubernetes.io/docs/user-guide/compute-resources/
resources:
requests:
cpu: 10m
memory: 150Mi
limits:
cpu: 300m
memory: 500Mi

0 comments on commit 4ff0eb8

Please sign in to comment.