Skip to content

Commit 4717a26

Browse files
author
tu1h
committed
See 0ekk/kubean@11d1b96 from refs/tags/v0.99.0
1 parent ea0f276 commit 4717a26

19 files changed

+524
-152
lines changed

charts/kubean/.relok8s-images.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# kubean-operator
2+
- "{{ .kubeanOperator.image.registry }}/{{ .kubeanOperator.image.repository }}:{{ .kubeanOperator.image.tag }}"
3+
# spray-job
4+
- "{{ .sprayJob.image.registry }}/{{ .sprayJob.image.repository }}:{{ .sprayJob.image.tag }}"
5+
# kubean-admission
6+
- "{{ .kubeanAdmission.image.registry }}/{{ .kubeanAdmission.image.repository }}:{{ .kubeanAdmission.image.tag }}"

charts/kubean/Chart.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: v2
22
name: kubean
33
description: A Helm chart for kubean
4-
54
# A chart can be either an 'application' or a 'library' chart.
65
#
76
# Application charts are a collection of templates that can be packaged into versioned archives
@@ -11,16 +10,13 @@ description: A Helm chart for kubean
1110
# a dependency of application charts to inject those utilities and functions into the rendering
1211
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1312
type: application
14-
1513
# This is the chart version. This version number should be incremented each time you make changes
1614
# to the chart and its templates, including the app version.
1715
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: v0.0.7
19-
16+
version: "v0.99.0"
2017
# This is the version number of the application being deployed. This version number should be
2118
# incremented each time you make changes to the application. Versions are not expected to
2219
# follow Semantic Versioning. They should reflect the version the application is using.
2320
# It is recommended to use it with quotes.
24-
appVersion: "0.0.1"
25-
21+
appVersion: "v0.99.0"
2622
icon: https://avatars.githubusercontent.com/u/108458246

charts/kubean/crds/kubean.io_clusteroperations.yaml

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -43,9 +42,23 @@ spec:
4342
properties:
4443
action:
4544
type: string
45+
actionSource:
46+
default: builtin
47+
type: string
48+
actionSourceRef:
49+
properties:
50+
name:
51+
type: string
52+
namespace:
53+
type: string
54+
required:
55+
- name
56+
- namespace
57+
type: object
4658
actionType:
4759
type: string
48-
backoffLimit:
60+
activeDeadlineSeconds:
61+
format: int64
4962
type: integer
5063
cluster:
5164
description: Cluster the name of Cluster.kubean.io.
@@ -83,6 +96,19 @@ spec:
8396
properties:
8497
action:
8598
type: string
99+
actionSource:
100+
default: builtin
101+
type: string
102+
actionSourceRef:
103+
properties:
104+
name:
105+
type: string
106+
namespace:
107+
type: string
108+
required:
109+
- name
110+
- namespace
111+
type: object
86112
actionType:
87113
type: string
88114
extraArgs:
@@ -97,6 +123,19 @@ spec:
97123
properties:
98124
action:
99125
type: string
126+
actionSource:
127+
default: builtin
128+
type: string
129+
actionSourceRef:
130+
properties:
131+
name:
132+
type: string
133+
namespace:
134+
type: string
135+
required:
136+
- name
137+
- namespace
138+
type: object
100139
actionType:
101140
type: string
102141
extraArgs:
@@ -106,6 +145,53 @@ spec:
106145
- actionType
107146
type: object
108147
type: array
148+
resources:
149+
description: ResourceRequirements describes the compute resource requirements.
150+
properties:
151+
claims:
152+
description: "Claims lists the names of resources, defined in
153+
spec.resourceClaims, that are used by this container. \n This
154+
is an alpha field and requires enabling the DynamicResourceAllocation
155+
feature gate. \n This field is immutable. It can only be set
156+
for containers."
157+
items:
158+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
159+
properties:
160+
name:
161+
description: Name must match the name of one entry in pod.spec.resourceClaims
162+
of the Pod where this field is used. It makes that resource
163+
available inside a container.
164+
type: string
165+
required:
166+
- name
167+
type: object
168+
type: array
169+
x-kubernetes-list-map-keys:
170+
- name
171+
x-kubernetes-list-type: map
172+
limits:
173+
additionalProperties:
174+
anyOf:
175+
- type: integer
176+
- type: string
177+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
178+
x-kubernetes-int-or-string: true
179+
description: 'Limits describes the maximum amount of compute resources
180+
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
181+
type: object
182+
requests:
183+
additionalProperties:
184+
anyOf:
185+
- type: integer
186+
- type: string
187+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
188+
x-kubernetes-int-or-string: true
189+
description: 'Requests describes the minimum amount of compute
190+
resources required. If Requests is omitted for a container,
191+
it defaults to Limits if that is explicitly specified, otherwise
192+
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
193+
type: object
194+
type: object
109195
sshAuthRef:
110196
description: SSHAuthRef will be filled by operator when it performs
111197
backup.
@@ -133,7 +219,6 @@ spec:
133219
required:
134220
- action
135221
- actionType
136-
- backoffLimit
137222
- cluster
138223
- image
139224
type: object

charts/kubean/crds/kubean.io_clusters.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -62,6 +61,16 @@ spec:
6261
- name
6362
- namespace
6463
type: object
64+
preCheckRef:
65+
properties:
66+
name:
67+
type: string
68+
namespace:
69+
type: string
70+
required:
71+
- name
72+
- namespace
73+
type: object
6574
sshAuthRef:
6675
description: SSHAuthRef stores ssh key and if it is empty ,then use
6776
sshpass.

charts/kubean/crds/kubean.io_localartifactsets.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition

charts/kubean/crds/kubean.io_manifests.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
@@ -90,6 +89,20 @@ spec:
9089
additionalProperties:
9190
type: string
9291
type: object
92+
imageRepoAuth:
93+
items:
94+
properties:
95+
imageRepoAddress:
96+
type: string
97+
passwordBase64:
98+
type: string
99+
userName:
100+
type: string
101+
type: object
102+
type: array
103+
imageRepoScheme:
104+
default: https
105+
type: string
93106
yumRepos:
94107
additionalProperties:
95108
items:

charts/kubean/templates/_helpers.tpl

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Expand the name of the chart.
33
*/}}
44
{{- define "kubean.name" -}}
5-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
5+
{{- default .Chart.Name .Values.kubeanOperator.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

88
{{- define "kubean.namespace" -}}
@@ -15,10 +15,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
1515
If release name contains chart name it will be used as a full name.
1616
*/}}
1717
{{- define "kubean.fullname" -}}
18-
{{- if .Values.fullnameOverride }}
19-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
18+
{{- if .Values.kubeanOperator.fullnameOverride }}
19+
{{- .Values.kubeanOperator.fullnameOverride | trunc 63 | trimSuffix "-" }}
2020
{{- else }}
21-
{{- $name := default .Chart.Name .Values.nameOverride }}
21+
{{- $name := default .Chart.Name .Values.kubeanOperator.nameOverride }}
2222
{{- if contains $name .Release.Name }}
2323
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
2424
{{- else }}
@@ -27,6 +27,10 @@ If release name contains chart name it will be used as a full name.
2727
{{- end }}
2828
{{- end }}
2929

30+
{{- define "kubean.admissionName" -}}
31+
{{- printf "%s-admission" .Release.Name }}
32+
{{- end }}
33+
3034
{{/*
3135
Create chart name and version as used by the chart label.
3236
*/}}
@@ -38,25 +42,38 @@ Create chart name and version as used by the chart label.
3842
Common labels
3943
*/}}
4044
{{- define "kubean.labels" -}}
41-
{{ include "kubean.selectorLabels" . }}
45+
{{ include "kubeanOperator.selectorLabels" . }}
4246
app.kubernetes.io/managed-by: {{ .Release.Service }}
4347
{{- end }}
4448

4549
{{/*
4650
Selector labels
4751
*/}}
48-
{{- define "kubean.selectorLabels" -}}
52+
{{- define "kubeanOperator.selectorLabels" -}}
4953
app.kubernetes.io/name: {{ include "kubean.name" . }}
5054
app.kubernetes.io/instance: {{ .Release.Name }}
5155
{{- end }}
5256

57+
{{- define "kubeanAdmission.selectorLabels" -}}
58+
app.kubernetes.io/name: {{ include "kubean.name" . }}
59+
app.kubernetes.io/instance: {{ printf "%s-admission-controller" .Release.Name }}
60+
{{- end }}
61+
62+
{{- define "kubeanAdmission.svcName" -}}
63+
{{- printf "%s-admission" .Chart.Name }}
64+
{{- end }}
65+
5366
{{/*
5467
Create the name of the service account to use
5568
*/}}
5669
{{- define "kubean.serviceAccountName" -}}
57-
{{- if .Values.serviceAccount.create }}
58-
{{- default (include "kubean.fullname" .) .Values.serviceAccount.name }}
70+
{{- if .Values.kubeanOperator.serviceAccount.create }}
71+
{{- default (include "kubean.fullname" .) .Values.kubeanOperator.serviceAccount.name }}
5972
{{- else }}
60-
{{- default "default" .Values.serviceAccount.name }}
73+
{{- default "default" .Values.kubeanOperator.serviceAccount.name }}
6174
{{- end }}
6275
{{- end }}
76+
77+
{{- define "kubean.prehookImage" -}}
78+
{{- printf "%s/%s:%s" .Values.sprayJob.image.registry .Values.sprayJob.image.repository (.Values.sprayJob.image.tag | default .Chart.Version) }}
79+
{{- end }}

charts/kubean/templates/clusterrole.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ rules:
2222
- apiGroups: ['authorization.k8s.io']
2323
resources: ['*']
2424
verbs: ['*']
25+
- apiGroups: ['admissionregistration.k8s.io']
26+
resources: ['*']
27+
verbs: ['*']

charts/kubean/templates/clusterrolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ roleRef:
99
name: {{ $name }}
1010
subjects:
1111
- kind: ServiceAccount
12-
name: {{ $name }}
12+
name: {{ include "kubean.serviceAccountName" . }}
1313
namespace: {{ include "kubean.namespace" . }}

charts/kubean/templates/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
5-
name: {{ include "kubean.fullname" . }}-config
5+
name: kubean-config
66
namespace: {{ include "kubean.namespace" . }}
77
labels:
88
{{- include "kubean.labels" . | nindent 4}}
99
data:
10-
BACKEND_LIMIT: "10"
10+
CLUSTER_OPERATIONS_BACKEND_LIMIT: "{{ .Values.kubeanOperator.operationsBackendLimit }}"

0 commit comments

Comments
 (0)