Skip to content

Commit

Permalink
See 0ekk/kubean@11d1b96 from refs/tags/v0.99.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tu1h committed Nov 20, 2023
1 parent ea0f276 commit 4717a26
Show file tree
Hide file tree
Showing 19 changed files with 524 additions and 152 deletions.
6 changes: 6 additions & 0 deletions charts/kubean/.relok8s-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# kubean-operator
- "{{ .kubeanOperator.image.registry }}/{{ .kubeanOperator.image.repository }}:{{ .kubeanOperator.image.tag }}"
# spray-job
- "{{ .sprayJob.image.registry }}/{{ .sprayJob.image.repository }}:{{ .sprayJob.image.tag }}"
# kubean-admission
- "{{ .kubeanAdmission.image.registry }}/{{ .kubeanAdmission.image.repository }}:{{ .kubeanAdmission.image.tag }}"
8 changes: 2 additions & 6 deletions charts/kubean/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apiVersion: v2
name: kubean
description: A Helm chart for kubean

# 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
Expand All @@ -11,16 +10,13 @@ description: A Helm chart for kubean
# 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: v0.0.7

version: "v0.99.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: "0.0.1"

appVersion: "v0.99.0"
icon: https://avatars.githubusercontent.com/u/108458246
91 changes: 88 additions & 3 deletions charts/kubean/crds/kubean.io_clusteroperations.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -43,9 +42,23 @@ spec:
properties:
action:
type: string
actionSource:
default: builtin
type: string
actionSourceRef:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
actionType:
type: string
backoffLimit:
activeDeadlineSeconds:
format: int64
type: integer
cluster:
description: Cluster the name of Cluster.kubean.io.
Expand Down Expand Up @@ -83,6 +96,19 @@ spec:
properties:
action:
type: string
actionSource:
default: builtin
type: string
actionSourceRef:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
actionType:
type: string
extraArgs:
Expand All @@ -97,6 +123,19 @@ spec:
properties:
action:
type: string
actionSource:
default: builtin
type: string
actionSourceRef:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
actionType:
type: string
extraArgs:
Expand All @@ -106,6 +145,53 @@ spec:
- actionType
type: object
type: array
resources:
description: ResourceRequirements describes the compute resource requirements.
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
sshAuthRef:
description: SSHAuthRef will be filled by operator when it performs
backup.
Expand Down Expand Up @@ -133,7 +219,6 @@ spec:
required:
- action
- actionType
- backoffLimit
- cluster
- image
type: object
Expand Down
11 changes: 10 additions & 1 deletion charts/kubean/crds/kubean.io_clusters.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -62,6 +61,16 @@ spec:
- name
- namespace
type: object
preCheckRef:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
sshAuthRef:
description: SSHAuthRef stores ssh key and if it is empty ,then use
sshpass.
Expand Down
1 change: 0 additions & 1 deletion charts/kubean/crds/kubean.io_localartifactsets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
15 changes: 14 additions & 1 deletion charts/kubean/crds/kubean.io_manifests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -90,6 +89,20 @@ spec:
additionalProperties:
type: string
type: object
imageRepoAuth:
items:
properties:
imageRepoAddress:
type: string
passwordBase64:
type: string
userName:
type: string
type: object
type: array
imageRepoScheme:
default: https
type: string
yumRepos:
additionalProperties:
items:
Expand Down
35 changes: 26 additions & 9 deletions charts/kubean/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Expand the name of the chart.
*/}}
{{- define "kubean.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- default .Chart.Name .Values.kubeanOperator.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "kubean.namespace" -}}
Expand All @@ -15,10 +15,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kubean.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- if .Values.kubeanOperator.fullnameOverride }}
{{- .Values.kubeanOperator.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- $name := default .Chart.Name .Values.kubeanOperator.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -27,6 +27,10 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{- define "kubean.admissionName" -}}
{{- printf "%s-admission" .Release.Name }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand All @@ -38,25 +42,38 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "kubean.labels" -}}
{{ include "kubean.selectorLabels" . }}
{{ include "kubeanOperator.selectorLabels" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "kubean.selectorLabels" -}}
{{- define "kubeanOperator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubean.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "kubeanAdmission.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubean.name" . }}
app.kubernetes.io/instance: {{ printf "%s-admission-controller" .Release.Name }}
{{- end }}

{{- define "kubeanAdmission.svcName" -}}
{{- printf "%s-admission" .Chart.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "kubean.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "kubean.fullname" .) .Values.serviceAccount.name }}
{{- if .Values.kubeanOperator.serviceAccount.create }}
{{- default (include "kubean.fullname" .) .Values.kubeanOperator.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- default "default" .Values.kubeanOperator.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "kubean.prehookImage" -}}
{{- printf "%s/%s:%s" .Values.sprayJob.image.registry .Values.sprayJob.image.repository (.Values.sprayJob.image.tag | default .Chart.Version) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/kubean/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ rules:
- apiGroups: ['authorization.k8s.io']
resources: ['*']
verbs: ['*']
- apiGroups: ['admissionregistration.k8s.io']
resources: ['*']
verbs: ['*']
2 changes: 1 addition & 1 deletion charts/kubean/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ roleRef:
name: {{ $name }}
subjects:
- kind: ServiceAccount
name: {{ $name }}
name: {{ include "kubean.serviceAccountName" . }}
namespace: {{ include "kubean.namespace" . }}
4 changes: 2 additions & 2 deletions charts/kubean/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "kubean.fullname" . }}-config
name: kubean-config
namespace: {{ include "kubean.namespace" . }}
labels:
{{- include "kubean.labels" . | nindent 4}}
data:
BACKEND_LIMIT: "10"
CLUSTER_OPERATIONS_BACKEND_LIMIT: "{{ .Values.kubeanOperator.operationsBackendLimit }}"
26 changes: 13 additions & 13 deletions charts/kubean/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ metadata:
labels:
{{- include "kubean.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: {{ .Values.kubeanOperator.replicaCount }}
selector:
matchLabels:
{{- include "kubean.selectorLabels" . | nindent 6 }}
{{- include "kubeanOperator.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.kubeanOperator.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "kubean.selectorLabels" . | nindent 8 }}
{{- include "kubeanOperator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.kubeanOperator.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "kubean.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.kubeanOperator.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 }}
{{- toYaml .Values.kubeanOperator.securityContext | nindent 12 }}
image: "{{ .Values.kubeanOperator.image.registry }}/{{ .Values.kubeanOperator.image.repository }}:{{ .Values.kubeanOperator.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.kubeanOperator.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- toYaml .Values.kubeanOperator.resources | nindent 12 }}
{{- with .Values.kubeanOperator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.kubeanOperator.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.kubeanOperator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 4717a26

Please sign in to comment.