Skip to content

Commit

Permalink
Move apireg annotation to operator pod (#64)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Apr 24, 2020
1 parent b02b054 commit a1ad35c
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/crds/bindata.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions api/crds/installer.kubedb.com_kubedboperators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,10 @@ spec:
- repository
- tag
type: object
podAnnotations:
additionalProperties:
type: string
type: object
podSecurityContext:
description: 'PodSecurityContext holds pod-level security attributes
and common container settings. Optional: Defaults to empty. See type
Expand Down
6 changes: 6 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,12 @@
"operator": {
"$ref": "#/definitions/dev.kubedb.installer.apis.installer.v1alpha1.OperatorContainer"
},
"podAnnotations": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"podSecurityContext": {
"description": "PodSecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.",
"$ref": "#/definitions/io.k8s.api.core.v1.PodSecurityContext"
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_operator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type KubeDBOperatorSpec struct {
LogLevel int32 `json:"logLevel"`
// +optional
Annotations map[string]string `json:"annotations"`
//+optional
PodAnnotations map[string]string `json:"podAnnotations"`
// +optional
NodeSelector map[string]string `json:"nodeSelector"`
// If specified, the pod's tolerations.
Expand Down
14 changes: 14 additions & 0 deletions apis/installer/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion charts/kubedb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ The following table lists the configurable parameters of the KubeDB chart and th
| `criticalAddon` | If true, installs KubeDB operator as critical addon | `false` |
| `logLevel` | Log level for operator | `3` |
| `affinity` | Affinity rules for pod assignment | `{}` |
| `annotations` | Annotations applied to operator pod(s) | `{}` |
| `annotations` | Annotations applied to operator deployment | `{}` |
| `podAnnotations` | Annotations applied to operator pod(s) | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Tolerations used pod assignment | `{}` |
| `resources.requests.cpu` | CPU resources request | `100m` |
Expand Down
8 changes: 3 additions & 5 deletions charts/kubedb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubedb.labels" . | nindent 4 }}
annotations:
checksum/apiregistration.yaml: {{ include (print $.Template.BasePath "/apiregistration.yaml") . | sha256sum }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand All @@ -22,15 +21,14 @@ spec:
metadata:
labels:
{{- include "kubedb.selectorLabels" . | nindent 8 }}
{{- if or .Values.annotations $criticalAddon }}
annotations:
checksum/apiregistration.yaml: {{ include (print $.Template.BasePath "/apiregistration.yaml") . | sha256sum }}
{{- if $criticalAddon }}
scheduler.alpha.kubernetes.io/critical-pod: ''
{{- end }}
{{- with .Values.annotations }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
4 changes: 4 additions & 0 deletions charts/kubedb/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ properties:
- repository
- tag
type: object
podAnnotations:
additionalProperties:
type: string
type: object
podSecurityContext:
description: 'PodSecurityContext holds pod-level security attributes and common
container settings. Optional: Defaults to empty. See type description for default
Expand Down
6 changes: 5 additions & 1 deletion charts/kubedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ criticalAddon: false
## Log level for operator
logLevel: 3

## Annotations passed to operator pod(s).
## Annotations passed to operator deployment.
##
annotations: {}

## Annotations passed to operator pod(s).
##
podAnnotations: {}

## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
Expand Down

0 comments on commit a1ad35c

Please sign in to comment.