-
Notifications
You must be signed in to change notification settings - Fork 9
WIP feat: undersync helm chart #1867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
skrobul
wants to merge
1
commit into
main
Choose a base branch
from
undersync-chart
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: v2 | ||
| appVersion: 1.0.0 | ||
| description: A lightweight standalone system to "sync" Openstack data to network switch. | ||
| name: undersync | ||
| type: application | ||
| version: 0.0.1 | ||
| maintainers: | ||
| - name: rackerlabs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "undersync.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "undersync.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "undersync.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "undersync.labels" -}} | ||
| helm.sh/chart: {{ include "undersync.chart" . }} | ||
| {{ include "undersync.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "undersync.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "undersync.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "undersync.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "undersync.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "undersync.fullname" . }} | ||
| labels: | ||
| {{- include "undersync.labels" . | nindent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "undersync.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "undersync.selectorLabels" . | nindent 8 }} | ||
| spec: | ||
| {{- with .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| securityContext: | ||
| {{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
| containers: | ||
| - name: {{ .Chart.Name }} | ||
| securityContext: | ||
| {{- toYaml .Values.securityContext | nindent 12 }} | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| ports: | ||
| - name: http | ||
| containerPort: 80 | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| env: | ||
| - name: asn | ||
| value: '{{ required "values.asn is required" .Values.asn }}' | ||
| - name: RACK_ENV | ||
| value: '{{ required "values.environment is required" .Values.environment }}' | ||
| - name: SETTINGS_FILE | ||
| value: '{{ .Values.settings_file_path | default "/run/secrets/undersync-settings/settings-file.yaml" }}' | ||
| - name: CLOUDS_FILE | ||
| value: '{{ .Values.clouds_file_path | default "/run/secrets/undersync-settings/clouds.yaml" }}' | ||
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "undersync.fullname" . }} | ||
| labels: | ||
| {{- include "undersync.labels" . | nindent 4 }} | ||
| spec: | ||
| type: {{ .Values.service.type }} | ||
| ports: | ||
| - port: {{ .Values.service.port }} | ||
| targetPort: http | ||
| protocol: TCP | ||
| name: http | ||
| selector: | ||
| {{- include "undersync.selectorLabels" . | nindent 4 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft-07/schema#", | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "asn": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 4294967294, | ||
| "description": "BGP Autonomous System Number (valid usable range: 1-4294967294).", | ||
| "default": 4294967294 | ||
| }, | ||
| "environment": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Deployment environment name (for example: production, staging).", | ||
| "default": "production" | ||
| }, | ||
| "nameOverride": { | ||
| "type": "string", | ||
| "description": "Override the chart name used for app labels and generated names." | ||
| }, | ||
| "fullnameOverride": { | ||
| "type": "string", | ||
| "description": "Fully override the generated Kubernetes resource name." | ||
| }, | ||
| "replicaCount": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "description": "Number of pod replicas to run.", | ||
| "default": 1 | ||
| }, | ||
| "service": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "type", | ||
| "port" | ||
| ], | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "ClusterIP", | ||
| "NodePort", | ||
| "LoadBalancer", | ||
| "ExternalName" | ||
| ], | ||
| "description": "Kubernetes Service type.", | ||
| "default": "ClusterIP" | ||
| }, | ||
| "port": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 65535, | ||
| "description": "Service port exposed for HTTP traffic.", | ||
| "default": 80 | ||
| } | ||
| } | ||
| }, | ||
| "image": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "repository", | ||
| "pullPolicy" | ||
| ], | ||
| "properties": { | ||
| "repository": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Container image repository." | ||
| }, | ||
| "tag": { | ||
| "type": "string", | ||
| "description": "Container image tag. Defaults to chart appVersion when empty." | ||
| }, | ||
| "pullPolicy": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "Always", | ||
| "IfNotPresent", | ||
| "Never" | ||
| ], | ||
| "description": "Kubernetes image pull policy.", | ||
| "default": "IfNotPresent" | ||
| } | ||
| } | ||
| }, | ||
| "imagePullSecrets": { | ||
| "type": "array", | ||
| "description": "Optional image pull secrets for private registries.", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "name" | ||
| ], | ||
| "properties": { | ||
| "name": { | ||
| "type": "string", | ||
| "minLength": 1 | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "podAnnotations": { | ||
| "type": "object", | ||
| "description": "Annotations applied to pod templates.", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| }, | ||
| "default": {} | ||
| }, | ||
| "podSecurityContext": { | ||
| "type": "object", | ||
| "description": "Pod-level securityContext configuration.", | ||
| "additionalProperties": true, | ||
| "default": {} | ||
| }, | ||
| "securityContext": { | ||
| "type": "object", | ||
| "description": "Container-level securityContext configuration.", | ||
| "additionalProperties": true | ||
| }, | ||
| "settings_file_path": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Path to undersync settings file mounted in the container.", | ||
| "default": "/run/secrets/undersync-settings/settings-file.yaml" | ||
| }, | ||
| "clouds_file_path": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "description": "Path to OpenStack clouds.yaml mounted in the container.", | ||
| "default": "/run/secrets/undersync-settings/clouds.yaml" | ||
| }, | ||
| "resources": { | ||
| "type": "object", | ||
| "description": "Container resource requests and limits.", | ||
| "additionalProperties": true, | ||
| "default": {} | ||
| }, | ||
| "nodeSelector": { | ||
| "type": "object", | ||
| "description": "Node selector labels for pod scheduling.", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| }, | ||
| "default": {} | ||
| }, | ||
| "tolerations": { | ||
| "type": "array", | ||
| "description": "Node taint tolerations for pod scheduling.", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": true | ||
| }, | ||
| "default": [] | ||
| }, | ||
| "affinity": { | ||
| "type": "object", | ||
| "description": "Affinity and anti-affinity rules for pod scheduling.", | ||
| "additionalProperties": true, | ||
| "default": {} | ||
| } | ||
| }, | ||
| "required": [ | ||
| "asn", | ||
| "environment", | ||
| "replicaCount", | ||
| "service", | ||
| "image" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| asn: 4294967294 | ||
| environment: production | ||
| service: | ||
| type: ClusterIP | ||
| port: 80 | ||
| replicaCount: 1 | ||
| image: | ||
| repository: ghcr.io/rss-engineering/undersync/undersync | ||
| pullPolicy: IfNotPresent | ||
| # Overrides the image tag whose default is the chart appVersion. | ||
| # tag: "" | ||
| imagePullSecrets: | ||
| - name: dockerconfigjson-github-com | ||
| podAnnotations: {} | ||
| podSecurityContext: {} | ||
| # fsGroup: 2000 | ||
|
|
||
| securityContext: | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| runAsNonRoot: true | ||
| runAsUser: 1000 | ||
| resources: {} | ||
| # We usually recommend not to specify default resources and to leave this as a conscious | ||
| # choice for the user. This also increases chances charts run on environments with little | ||
| # resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
| # lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
| # limits: | ||
| # cpu: 100m | ||
| # memory: 128Mi | ||
| # requests: | ||
| # cpu: 100m | ||
| # memory: 128Mi | ||
|
|
||
| nodeSelector: {} | ||
| tolerations: [] | ||
| affinity: {} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asn is required by the template. We should not provide a default, this is specific to every deployment.