Skip to content

Commit

Permalink
Update-2022-06-16_15:21:06
Browse files Browse the repository at this point in the history
  • Loading branch information
pogossian committed Jun 16, 2022
1 parent f4740ef commit e2ada85
Show file tree
Hide file tree
Showing 12 changed files with 435 additions and 127 deletions.
6 changes: 4 additions & 2 deletions charts/netris-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ 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: 1.0.14
version: 1.0.15-rc.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: 3.0.9
appVersion: 3.0.10-rc.0
home: https://netris.ai
icon: https://www.netris.ai/wp-content/uploads/2021/01/logo-300.png # [todo] Change url to permalink
keywords:
Expand Down Expand Up @@ -53,3 +53,5 @@ dependencies:
- name: graphite
version: 0.7.2
repository: https://kiwigrid.github.io
annotations:
artifacthub.io/prerelease: "true"
31 changes: 29 additions & 2 deletions charts/netris-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following table lists the configurable parameters of the netris-controller c
| ------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- |
| `app.replicaCount` | Number of replicas in app deployment | `1` |
| `app.image.repository` | Image repository | `netrisai/controller-web-service` |
| `app.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"3.0.9-014"` |
| `app.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"3.0.10-012"` |
| `app.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `app.imagePullSecrets` | Reference to one or more secrets to be used when pulling images | `[]` |
| `app.service.type` | Kubernetes service type | `ClusterIP` |
Expand All @@ -102,7 +102,7 @@ The following table lists the configurable parameters of the netris-controller c
| -------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- |
| `grpc.replicaCount` | Number of replicas in grpc deployment | `1` |
| `grpc.image.repository` | Image repository | `netrisai/controller-grpc` |
| `grpc.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"3.0.8.002"` |
| `grpc.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"3.0.10.002"` |
| `grpc.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `grpc.imagePullSecrets` | Reference to one or more secrets to be used when pulling images | `[]` |
| `grpc.service.type` | Kubernetes service type | `ClusterIP` |
Expand Down Expand Up @@ -147,6 +147,33 @@ The following table lists the configurable parameters of the netris-controller c
| `telescope-notifier.autoscaling.targetCPUUtilizationPercentage` | The desired target CPU utilization for autoscaling | `80` |


### Netris-Controller web-session-generator parameters
| Parameter | Description | Default |
| ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- |
| `web-session-generator.replicaCount` | Number of replicas in web-session-generator deployment | `1` |
| `web-session-generator.image.repository` | Image repository | `netrisai/controller-web-session-generator` |
| `web-session-generator.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"0.2.0"` |
| `web-session-generator.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `web-session-generator.imagePullSecrets` | Reference to one or more secrets to be used when pulling images | `[]` |
| `web-session-generator.service.type` | Kubernetes service type | `ClusterIP` |
| `web-session-generator.service.port` | Kubernetes port where service is expose | `80` |
| `web-session-generator.service.portName` | Name of the port on the service | `http` |
| `web-session-generator.autoscaling.enabled` | Option to turn autoscaling on for app and specify params for HPA. Autoscaling needs metrics-server to access cpu metrics | `false` |
| `web-session-generator.autoscaling.minReplicas` | Default min replicas for autoscaling | `1` |
| `web-session-generator.autoscaling.maxReplicas` | Default max replicas for autoscaling | `100` |
| `web-session-generator.autoscaling.targetCPUUtilizationPercentage` | The desired target CPU utilization for autoscaling | `80` |


### Netris-Controller equinix-metal-agent parameters
| Parameter | Description | Default |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------- |
| `equinix-metal-agent.enabled` | Enable equinix-metal-agent deployment | `true` |
| `equinix-metal-agent.image.repository` | Image repository | `netrisai/bare-metal-equinix-metal-agent` |
| `equinix-metal-agent.image.tag` | Image tag. Overrides the image tag whose default is the chart appVersion | `"0.3.1"` |
| `equinix-metal-agent.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `equinix-metal-agent.imagePullSecrets` | Reference to one or more secrets to be used when pulling images | `[]` |


### Mariadb parameters
_Using default values [from](https://github.com/bitnami/charts/tree/master/bitnami/mariadb/values.yaml)_

Expand Down
12 changes: 12 additions & 0 deletions charts/netris-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ Generate certificates for netris-controller api server
tls.crt: {{ $cert.Cert | b64enc }}
tls.key: {{ $cert.Key | b64enc }}
{{- end -}}

{{/*
Generate a web-session-secret secret or use the existing one
*/}}
{{- define "web.session.secret" -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace (printf "%s-%s" (include "netris-controller.fullname" .) "web-session-secret") -}}
{{- if $secret }}
secret-key: {{ (index $secret.data "secret-key") }}
{{- else }}
secret-key: {{ randAlphaNum 40 | b64enc }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/netris-controller/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ spec:
value: {{ printf "%s-%s" (include "netris-controller.fullname" .) "telescope" }}:{{ (.Values.telescope.service.port ) }}
- name: GRAPHITE_WEBAPP_URL
value: {{ printf "%s%s-%s" "http://" (include "netris-controller.fullname" .) "graphite" }}:{{ printf "%s%s" (.Values.graphite.service.port |toString ) "/render/" }}
- name: WEB_SESSION_SECRET
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" (include "netris-controller.fullname" .) "web-session-secret" }}
key: secret-key
ports:
- name: {{ (index .Values $microservicename).service.name }}
containerPort: {{ (index .Values $microservicename).service.port }}
Expand Down Expand Up @@ -243,4 +248,3 @@ spec:
command: ['wget']
args: ['{{ printf "%s-%s" (include "netris-controller.fullname" .) $microservicename }}:{{ (index .Values $microservicename).service.port }}']
restartPolicy: Never
...
73 changes: 73 additions & 0 deletions charts/netris-controller/templates/equinix-metal-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
{{- if (index .Values "equinix-metal-agent").enabled }}
{{- $microservicename := "equinix-metal-agent" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ printf "%s-%s" (include "netris-controller.fullname" .) $microservicename }}
labels:
{{- include "netris-controller.labels" . | nindent 4 }}
{{- printf "%s-%s" (include "netris-controller.selectorLabels" .) $microservicename | nindent 4 }}
spec:
selector:
matchLabels:
{{- printf "%s-%s" (include "netris-controller.selectorLabels" .) $microservicename | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- printf "%s-%s" (include "netris-controller.selectorLabels" .) $microservicename | nindent 8 }}
spec:
{{- with (index .Values $microservicename).imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "netris-controller.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: init-wait-webapp
image: alpine:3.11
command:
- sh
- -c
- for i in $(seq 1 200); do nc -z -w3 {{ printf "%s-%s" (include "netris-controller.fullname" .) "app" }} {{ .Values.app.service.port }} && exit 0 || sleep 3; done; exit 1
containers:
- name: {{ printf "%s-%s" .Chart.Name $microservicename }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ (index .Values $microservicename).image.repository }}:{{ (index .Values $microservicename).image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ (index .Values $microservicename).image.pullPolicy }}
command: ['/app/servicebin']
env:
- name: EQUINIX_METAL_AGENT_LOG_LEVEL
value: info
- name: EQUINIX_ADDR
value: https://api.packet.net
- name: CONTROLLER_ADDR
value: http://{{ printf "%s-%s" (include "netris-controller.fullname" .) "app" }}:{{ .Values.app.service.port }}
- name: SESSION_PROVIDER_HOST
value: http://{{ printf "%s-%s" (include "netris-controller.fullname" .) "web-session-generator" }}:{{ (index .Values "web-session-generator").service.port }}
- name: WEB_SESSION_SECRET
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" (include "netris-controller.fullname" .) "web-session-secret" }}
key: secret-key
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/netris-controller/templates/grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,3 @@ data:
password={{ .Values.mariadb.auth.password }}
database={{ .Values.mariadb.auth.database }}
port={{ .Values.mariadb.primary.service.port }}
...
Loading

0 comments on commit e2ada85

Please sign in to comment.