diff --git a/charts/ix-chart/2009.0.1/templates/_workload.tpl b/charts/ix-chart/2009.0.1/templates/_workload.tpl index e28eb5a9f52..dfb823eb002 100644 --- a/charts/ix-chart/2009.0.1/templates/_workload.tpl +++ b/charts/ix-chart/2009.0.1/templates/_workload.tpl @@ -94,8 +94,8 @@ Deployment Spec strategy: type: {{ .Values.updateStrategy }} selector: -matchLabels: - {{- include "ix-chart.selectorLabels" . | nindent 2 }} + matchLabels: + {{- include "ix-chart.selectorLabels" . | nindent 4 }} template: metadata: {{ include "commonMetadataWorkload" . | nindent 4 }} diff --git a/charts/ix-chart/2010.0.1/.helmignore b/charts/ix-chart/2010.0.1/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/charts/ix-chart/2010.0.1/.helmignore @@ -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/ diff --git a/charts/ix-chart/2010.0.1/Chart.yaml b/charts/ix-chart/2010.0.1/Chart.yaml new file mode 100644 index 00000000000..3ffb1abda44 --- /dev/null +++ b/charts/ix-chart/2010.0.1/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: ix-chart +description: A Helm chart for deploying simple workloads Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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: 2010.0.1 + +# 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. +appVersion: v1 diff --git a/charts/ix-chart/2010.0.1/README.md b/charts/ix-chart/2010.0.1/README.md new file mode 100644 index 00000000000..1c3372364b2 --- /dev/null +++ b/charts/ix-chart/2010.0.1/README.md @@ -0,0 +1 @@ +blah blah \ No newline at end of file diff --git a/charts/ix-chart/2010.0.1/app-readme.md b/charts/ix-chart/2010.0.1/app-readme.md new file mode 100644 index 00000000000..1c3372364b2 --- /dev/null +++ b/charts/ix-chart/2010.0.1/app-readme.md @@ -0,0 +1 @@ +blah blah \ No newline at end of file diff --git a/charts/ix-chart/2010.0.1/questions.yaml b/charts/ix-chart/2010.0.1/questions.yaml new file mode 100644 index 00000000000..53a53d3f0c6 --- /dev/null +++ b/charts/ix-chart/2010.0.1/questions.yaml @@ -0,0 +1,305 @@ +# Workload type +- variable: workloadType + description: "Please specify type of workload to deploy" + label: "Workload Type" + schema: + type: string + default: "Deployment" + required: true + enum: + - "Deployment" + - "Job" + - "CronJob" + +# Cronjob schedule +- variable: cronSchedule + label: "Cron Schedule" + schema: + type: cron + show_if: [["workloadType", "=", "CronJob"]] + default: + minute: "5" + +# Image related +- variable: image + description: "Docker Image Details" + group: "Container Images" + schema: + type: dict + required: true + attrs: + - variable: repository + description: "Docker image repository" + label: "Image repository" + group: "Container Images" + schema: + type: string + required: true + - variable: tag + description: "Tag to use for specified image" + label: "Image Tag" + group: "Container Images" + schema: + type: string + default: "latest" + - variable: pullPolicy + description: "Docker Image Pull Policy" + label: "Image Pull Policy" + group: "Container Images" + schema: + type: string + default: "IfNotPresent" + enum: + - "IfNotPresent" + - "Always" + - "Never" + +# Update strategy +- variable: updateStrategy + description: "Upgrade Policy" + label: "Update Strategy" + schema: + type: string + show_if: [["workloadType", "=", "Deployment"]] + default: "RollingUpdate" + enum: + - "RollingUpdate" + - "Recreate" + +# Restart Policy +- variable: restartPolicy + description: "Restart Policy for workload" + label: "Restart Policy" + schema: + type: string + show_if: [["workloadType", "=", "Deployment"]] + default: "Always" + enum: + - "Always" + - "OnFailure" + - "Never" +- variable: jobRestartPolicy + description: "Restart Policy for workload" + label: "Restart Policy" + schema: + type: string + default: "OnFailure" + show_if: [["workloadType", "!=", "Deployment"]] + enum: + - "OnFailure" + - "Never" + +# Configurable CMD / Entrypoint / Environment Variables +- variable: containerCommand + description: "Commands to execute inside container overriding image CMD default" + label: "Container CMD" + group: "Container Entrypoint" + schema: + type: list + items: + - variable: command + description: "Container Command" + label: "Command" + schema: + type: string +- variable: containerArgs + description: "Specify arguments for container command" + label: "Container Args" + group: "Container Entrypoint" + schema: + type: list + items: + - variable: arg + description: "Container Arg" + label: "Arg" + schema: + type: string +- variable: containerEnvironmentVariables + description: "Container Environment Variables" + label: "Container Environment Variables" + group: "Container Entrypoint" + schema: + type: list + items: + - variable: environmentVariable + description: "Container Environment Variable" + label: "Container Environment Variable" + schema: + type: dict + attrs: + - variable: name + description: "Environment Variable Name" + label: "Environment Variable Name" + schema: + type: string + required: true + - variable: value + description: "Environment Variable Value" + label: "Environment Variable Value" + schema: + type: string + required: true + +# Networking options +- variable: externalInterfaces + description: "Add External Interfaces" + label: "Add external Interfaces" + group: "Networking" + schema: + type: list + items: + - variable: interfaceConfiguration + description: "Interface Configuration" + label: "Interface Configuration" + schema: + type: dict + $ref: + - "normalise/interfaceConfiguration" + attrs: + - variable: hostInterface + description: "Please specify host interface" + label: "Host Interface" + schema: + type: string + required: true + $ref: + - "definitions/interface" + - variable: ipam + description: "Define how IP Address will be managed" + label: "IP Address Management" + schema: + type: dict + required: true + attrs: + - variable: type + description: "Specify type for IPAM" + label: "IPAM Type" + schema: + type: string + required: true + enum: + - "dhcp" + - "static" + show_subquestions_if: "static" + subquestions: + - variable: staticIPConfigurations + label: "Static IP Addresses" + schema: + type: list + items: + - variable: staticIP + label: "Static IP" + schema: + type: ipaddr + cidr: true + - variable: staticRoutes + label: "Static Routes" + schema: + type: list + items: + - variable: staticRouteConfiguration + label: "Static Route Configuration" + schema: + type: dict + attrs: + - variable: destination + label: "Destination" + schema: + type: ipaddr + cidr: true + required: true + - variable: gateway + label: "Gateway" + schema: + type: ipaddr + cidr: false + required: true + +# Storage Options +# Host path based volumes +- variable: hostPathVolumes + label: "Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: hostPathConfiguration + label: "Host Path Configuration" + schema: + type: dict + attrs: + - variable: hostPath + label: "Host Path" + schema: + type: hostpath + required: true + - variable: mountPath + label: "Mount Path" + description: "Path where host path will be mounted inside the pod" + schema: + type: path + required: true + - variable: readOnly + label: "Read Only" + schema: + type: boolean + default: false + +# Persistent Volume Claims +- variable: persistentVolumeClaims + label: "Persistent Volume Claims" + group: "Storage" + schema: + type: list + items: + - variable: persistentVolumeClaim + label: "Persistent Volume Claim Configuration" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: capacity + label: "Volume Capacity" + schema: + type: int + required: true + +# Pod Probes +# Liveness Probe +- variable: livenessProbe + label: "Liveness Probe" + description: "Configure Liveness Probe" + group: "Probes" + schema: + type: dict + default: null + "null": true + attrs: + - variable: command + label: "Liveness command" + description: "Specify a command to determine liveness of pod" + schema: + type: list + required: true + items: + - variable: commandArg + label: "Command Arg" + schema: + type: string + - variable: initialDelaySeconds + label: "Seconds Delay" + description: "Seconds to delay the first liveness probe" + schema: + type: int + default: 5 + - variable: periodSeconds + label: "Period Seconds" + description: "Specify number of seconds to run liveness probe" + schema: + type: int + default: 10 diff --git a/charts/ix-chart/2010.0.1/templates/NOTES.txt b/charts/ix-chart/2010.0.1/templates/NOTES.txt new file mode 100644 index 00000000000..c3b3453e34b --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/NOTES.txt @@ -0,0 +1,2 @@ +1. Get the application URL by running these commands: + diff --git a/charts/ix-chart/2010.0.1/templates/_containers.tpl b/charts/ix-chart/2010.0.1/templates/_containers.tpl new file mode 100644 index 00000000000..95e9a2bc886 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/_containers.tpl @@ -0,0 +1,50 @@ +{{/* +Container Command +*/}} +{{- define "containerCommand" }} +{{- if .Values.containerCommand }} +command: + {{- range .Values.containerCommand }} + - {{ . | quote}} + {{- end }} +{{- end }} +{{- end }} + +{{/* +Container Args +*/}} +{{- define "containerArgs" }} +{{- if .Values.containerArgs }} +args: + {{- range .Values.containerArgs }} + - {{ . | quote}} + {{- end }} +{{- end }} +{{- end }} + +{{/* +Container Environment Variables +*/}} +{{- define "containerEnvVariables" }} +{{- if .Values.containerEnvironmentVariables }} +env: + {{- range .Values.containerEnvironmentVariables }} + - name: {{ .name | quote }} + value: {{ .value | quote }} + {{- end }} +{{- end }} +{{- end }} + +{{/* +Container Liveness Probe +*/}} +{{- define "containerLivenssProbe" }} +{{- if .Values.livenessProbe }} +livenessProbe: + exec: + command: + {{ toYaml .Values.livenessProbe.command | indent 16 }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.periodSeconds }} +{{- end }} +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/_helpers.tpl b/charts/ix-chart/2010.0.1/templates/_helpers.tpl new file mode 100644 index 00000000000..3d22e96fac0 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/_helpers.tpl @@ -0,0 +1,71 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "ix-chart.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 "ix-chart.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 "ix-chart.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ix-chart.labels" -}} +helm.sh/chart: {{ include "ix-chart.chart" . }} +{{ include "ix-chart.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ix-chart.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ix-chart.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ix-chart.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ix-chart.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + + +{{/* +Convert cron schema object to cron format +*/}} +{{- define "cronExpression" }} +{{- printf "%s %s %s %s %s " .minute .hour .dom .month .dow }} +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/_volumes.tpl b/charts/ix-chart/2010.0.1/templates/_volumes.tpl new file mode 100644 index 00000000000..d40799b294a --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/_volumes.tpl @@ -0,0 +1,36 @@ +{{/* +Volumes Configuration +*/}} +{{- define "volumeConfiguration" }} +{{- if or .Values.persistentVolumeClaims .Values.hostPathVolumes }} +volumes: +{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }} + - name: ix-host-path-{{ $.Release.Name }}-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} +{{- end }} +{{- range $index, $claim := .Values.persistentVolumeClaims }} + - name: ix-pv-{{ $.Release.Name }}-{{ $index }} + persistentVolumeClaim: + claimName: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Volume Mounts Configuration +*/}} +{{- define "volumeMountsConfiguration" }} +{{- if or .Values.hostPathVolumes .Values.persistentVolumeClaims }} +volumeMounts: + {{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }} + - mountPath: {{ $hostPathConfiguration.mountPath }} + name: ix-host-path-{{ $.Release.Name }}-{{ $index }} + readOnly: {{ $hostPathConfiguration.readOnly }} + {{- end }} + {{- range $index, $claim := .Values.persistentVolumeClaims }} + - mountPath: {{ $claim.mountPath }} + name: ix-pv-{{ $.Release.Name }}-{{ $index }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/_workload.tpl b/charts/ix-chart/2010.0.1/templates/_workload.tpl new file mode 100644 index 00000000000..dfb823eb002 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/_workload.tpl @@ -0,0 +1,134 @@ +{{/* +Check if workload type is a deployment +*/}} +{{- define "workloadIsDeployment" }} +{{- if eq .Values.workloadType "Deployment" }} +{{- true -}} +{{- else }} +{{- false -}} +{{- end }} +{{- end }} + +{{/* +Check if workload type is a cronjob +*/}} +{{- define "workloadIsCronJob" }} +{{- if eq .Values.workloadType "CronJob" }} +{{- true -}} +{{- else }} +{{- false -}} +{{- end }} +{{- end }} + +{{/* +Get API Version based on workload type +*/}} +{{- define "apiVersion" -}} +{{- if eq (include "workloadIsDeployment" .) "true" }} +{{- printf "apps/v1" }} +{{- else if eq (include "workloadIsCronJob" .) "true" }} +{{- printf "batch/v1beta1" }} +{{- else }} +{{- printf "batch/v1" }} +{{- end }} +{{- end }} + + +{{/* +Get Restart policy based on workload type +*/}} +{{- define "restartPolicy" -}} +{{- if eq (include "workloadIsDeployment" .) "true" }} +{{- printf "%s" .Values.restartPolicy }} +{{- else }} +{{- printf "%s" .Values.jobRestartPolicy }} +{{- end }} +{{- end }} + + +{{/* +Pod specification +*/}} +{{- define "podSepc" }} +restartPolicy: {{ template "restartPolicy" . }} +containers: +- name: {{ .Chart.Name }} + {{- include "volumeMountsConfiguration" . | indent 2}} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- include "containerCommand" . | indent 2 }} + {{- include "containerArgs" . | indent 2 }} + {{- include "containerEnvVariables" . | indent 2 }} + {{- include "containerLivenssProbe" . | indent 2 }} +{{- include "volumeConfiguration" . }} +{{- end }} + + +{{/* +Annotations for workload +*/}} +{{- define "workloadAnnotations" }} +rollme: {{ randAlphaNum 5 | quote }} +{{- if .Values.ixExternalInterfacesConfigurationNames }} +k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }} +{{- end }} +{{- end }} + + +{{/* +Metadata for workload +*/}} +{{- define "commonMetadataWorkload" }} +labels: + {{- include "ix-chart.selectorLabels" . | nindent 2 }} +annotations: + {{- include "workloadAnnotations" . | nindent 2 }} +{{- end }} + +{{/* +Deployment Spec +*/}} +{{- define "deploymentSpec" }} +strategy: + type: {{ .Values.updateStrategy }} +selector: + matchLabels: + {{- include "ix-chart.selectorLabels" . | nindent 4 }} +template: + metadata: + {{ include "commonMetadataWorkload" . | nindent 4 }} + spec: + {{- include "podSepc" . | indent 4 }} +{{- end }} + + +{{/* +Job Spec Common +*/}} +{{- define "jobSpecCommon" }} +metadata: + {{ include "commonMetadataWorkload" . | nindent 4 }} +spec: + {{- include "podSepc" . | indent 2 }} +{{- end }} + + +{{/* +Job Spec +*/}} +{{- define "jobSpec" }} +template: +{{ include "jobSpecCommon" . | nindent 2 }} +{{- end }} + +{{/* +CronJob Spec +*/}} +{{- define "cronJobSpec" }} +schedule: {{ include "cronExpression" .Values.cronSchedule | quote }} +jobTemplate: + spec: + {{ include "jobSpec" . | nindent 4 }} +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/external-interfaces.yaml b/charts/ix-chart/2010.0.1/templates/external-interfaces.yaml new file mode 100644 index 00000000000..f68c46f6b17 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/external-interfaces.yaml @@ -0,0 +1,9 @@ +{{- range $index, $iface := .Values.ixExternalInterfacesConfiguration }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: ix-{{ $.Release.Name }}-{{ $index }} +spec: + config: '{{ $iface }}' +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml b/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml new file mode 100644 index 00000000000..0f082766fd1 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/persistent-volume-claims.yaml @@ -0,0 +1,14 @@ +{{- range $index, $claim := .Values.persistentVolumeClaims }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ix-pv-claim-{{ $.Release.Name }}-{{ $index }} +spec: + storageClassName: ix-storage-class-{{ $.Release.Name }} + resources: + requests: + storage: {{ $claim.capacity }} + accessModes: + - ReadWriteMany +{{- end }} diff --git a/charts/ix-chart/2010.0.1/templates/workload.yaml b/charts/ix-chart/2010.0.1/templates/workload.yaml new file mode 100644 index 00000000000..98df32b18a2 --- /dev/null +++ b/charts/ix-chart/2010.0.1/templates/workload.yaml @@ -0,0 +1,14 @@ +apiVersion: {{ template "apiVersion" . }} +kind: {{ .Values.workloadType }} +metadata: + name: {{ include "ix-chart.fullname" . }} + labels: + {{- include "ix-chart.labels" . | nindent 4 }} +spec: + {{- if eq (include "workloadIsDeployment" .) "true" }} + {{ include "deploymentSpec" . | nindent 2 }} + {{- else if eq (include "workloadIsCronJob" .) "true" }} + {{ include "cronJobSpec" . | nindent 2 }} + {{- else }} + {{ include "jobSpec" . | nindent 2 }} + {{- end }} diff --git a/charts/ix-chart/2010.0.1/values.yaml b/charts/ix-chart/2010.0.1/values.yaml new file mode 100644 index 00000000000..2c2b0484492 --- /dev/null +++ b/charts/ix-chart/2010.0.1/values.yaml @@ -0,0 +1,23 @@ +# Default values for ix-chart. + +image: + repository: debian + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "testing" + +# Container CMD / entrypoint +containerCommand: [] +containerArgs: [] +containerEnvironmentVariables: [] + +# Network related configuration +externalInterfaces: [] + +# Storage related configuration +hostPathVolumes: [] +persistentVolumeClaims: [] + +# Probes +# Liveness Probe +livenessProbe: null