Skip to content
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

Feat/wk/schedule v2 #94

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,078 changes: 1,077 additions & 1 deletion charts/crds/kdoctor.io_apphttphealthies.yaml

Large diffs are not rendered by default.

1,078 changes: 1,077 additions & 1 deletion charts/crds/kdoctor.io_netdnses.yaml

Large diffs are not rendered by default.

1,078 changes: 1,077 additions & 1 deletion charts/crds/kdoctor.io_netreaches.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,26 +1,61 @@
apiVersion: apps/v1
kind: DaemonSet
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.kdoctorAgent.name | trunc 63 | trimSuffix "-" }}
name: {{ .Values.global.configAppTemplate }}
namespace: {{ .Release.Namespace }}
{{- if .Values.global.commonLabels }}
labels:
{{- include "project.kdoctorAgent.labels" . | nindent 4 }}
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
{{- if .Values.global.commonAnnotations }}
annotations:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 6 }}
{{- with .Values.kdoctorAgent.updateStrategy }}
updateStrategy:
{{- toYaml . | trim | nindent 4 }}
{{- end }}
template:
data:
daemonset.yml: |
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ .Values.kdoctorAgent.name | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace }}
{{- if .Values.global.commonLabels }}
labels:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.global.commonAnnotations }}
annotations:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 8 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 10 }}
{{- with .Values.kdoctorAgent.updateStrategy }}
updateStrategy:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
deployment.yml: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.kdoctorAgent.name | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace }}
{{- if .Values.global.commonLabels }}
labels:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.global.commonAnnotations }}
annotations:
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 8 }}
{{- end }}
spec:
replicas: 0
selector:
matchLabels:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 10 }}
pod.yml: |
apiVersion: v1
kind: Pod
metadata:
{{- if or .Values.kdoctorAgent.podAnnotations .Values.global.commonAnnotations }}
annotations:
Expand All @@ -41,9 +76,9 @@ spec:
{{- end }}
spec:
{{- if .Values.kdoctorAgent.image.imagePullSecrets }}
imagePullSecrets:
{{- with .Values.kdoctorAgent.image.imagePullSecrets }}
{{- toYaml . | trim | nindent 6 }}
imagePullSecrets:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ .Values.kdoctorAgent.name | trunc 63 | trimSuffix "-" }}
Expand All @@ -58,15 +93,15 @@ spec:
restartPolicy: Always
{{- with .Values.kdoctorAgent.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kdoctorAgent.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.kdoctorAgent.affinity }}
affinity:
{{- include "tplvalues.render" (dict "value" .Values.kdoctorAgent.affinity "context" $) | nindent 6 }}
{{- include "tplvalues.render" (dict "value" .Values.kdoctorAgent.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
nodeAffinity:
Expand Down Expand Up @@ -95,7 +130,7 @@ spec:
- --tls-ca-cert=/etc/tls/ca.crt
- --tls-ca-key=/etc/tls/ca.key
{{- with .Values.kdoctorAgent.extraArgs }}
{{- toYaml . | trim | nindent 8 }}
{{- toYaml . | trim | nindent 12 }}
{{- end }}
ports:
{{- if .Values.kdoctorAgent.prometheus.enabled }}
Expand Down Expand Up @@ -146,7 +181,7 @@ spec:
timeoutSeconds: 5
{{- with .Values.kdoctorAgent.resources }}
resources:
{{- toYaml . | trim | nindent 12 }}
{{- toYaml . | trim | nindent 12 }}
{{- end }}
env:
- name: ENV_LOG_LEVEL
Expand Down Expand Up @@ -192,11 +227,11 @@ spec:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.kdoctorAgent.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.kdoctorAgent.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config-path
Expand All @@ -207,7 +242,7 @@ spec:
- name: tls
mountPath: /etc/tls
{{- if .Values.kdoctorAgent.extraVolumes }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.extraVolumeMounts "context" $ ) | nindent 14 }}
{{- end }}
volumes:
# To read the configuration from the config map
Expand All @@ -231,5 +266,48 @@ spec:
path: ca.crt
name: {{ .Values.tls.ca.secretName }}
{{- if .Values.kdoctorAgent.extraVolumeMounts }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.extraVolumeMounts "context" $ ) | nindent 6 }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.extraVolumeMounts "context" $ ) | nindent 10 }}
{{- end }}
service.yml: |
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace | quote }}
{{- if or .Values.global.commonAnnotations .Values.kdoctorAgent.service.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.kdoctorAgent.service.annotations }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.service.annotations "context" $ ) | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- include "project.kdoctorAgent.labels" . | nindent 8 }}
spec:
type: {{ .Values.kdoctorAgent.service.type }}
ports:
{{- if .Values.kdoctorAgent.prometheus.enabled }}
- name: metrics
port: {{ .Values.kdoctorAgent.prometheus.port }}
targetPort: metrics
protocol: TCP
{{- end }}
{{- if .Values.feature.enableIPv4 }}
- name: http
port: {{ .Values.kdoctorAgent.httpServer.appHttpPort }}
targetPort: http
protocol: TCP
- name: https
port: {{ .Values.kdoctorAgent.httpServer.appHttpsPort }}
targetPort: https
protocol: TCP
{{- end }}
ipFamilyPolicy: SingleStack
ipFamilies:
- IPv4
selector:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 8 }}
2 changes: 2 additions & 0 deletions charts/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ data:
{{- end }}
agentDaemonsetName: {{ .Values.kdoctorAgent.name | trunc 63 | trimSuffix "-" }}
agentIngressName: {{ include "project.kdoctorAgent.ingressName" . }}
kdoctorAgent:
uniqueMatchLabelKey: {{ .Values.kdoctorAgent.uniqueMatchLabelKey }}
10 changes: 10 additions & 0 deletions charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
- {{ .Values.kdoctorController.cmdBinName }}
args:
- --config-path=/tmp/config-map/conf.yml
- --configmap-deployment-template=/tmp/configmap-app-template/deployment.yml
- --configmap-daemonset-template=/tmp/configmap-app-template/daemonset.yml
- --configmap-pod-template=/tmp/configmap-app-template/pod.yml
- --configmap-service-template=/tmp/configmap-app-template/service.yml
- --tls-ca-cert=/etc/tls/ca.crt
- --tls-server-cert=/etc/tls/tls.crt
- --tls-server-key=/etc/tls/tls.key
Expand Down Expand Up @@ -178,6 +182,9 @@ spec:
- name: config-path
mountPath: /tmp/config-map
readOnly: true
- name: configmap-app-template
mountPath: /tmp/configmap-app-template
readOnly: true
{{- if .Values.feature.aggregateReport.enabled }}
- name: report-data
mountPath: /report
Expand Down Expand Up @@ -205,6 +212,9 @@ spec:
- name: config-path
configMap:
name: {{ .Values.global.configName }}
- name: configmap-app-template
configMap:
name: {{ .Values.global.configAppTemplate }}
- name: tls
projected:
defaultMode: 0400
Expand Down
92 changes: 0 additions & 92 deletions charts/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,95 +1,3 @@
{{- if .Values.feature.enableIPv4 }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "project.kdoctorAgent.serviceIpv4Name" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if or .Values.global.commonAnnotations .Values.kdoctorAgent.service.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.kdoctorAgent.service.annotations }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.service.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- include "project.kdoctorAgent.labels" . | nindent 4 }}
spec:
type: {{ .Values.kdoctorAgent.service.type }}
ports:
{{- if .Values.kdoctorAgent.prometheus.enabled }}
- name: metrics
port: {{ .Values.kdoctorAgent.prometheus.port }}
targetPort: metrics
protocol: TCP
{{- end }}
{{- if .Values.feature.enableIPv4 }}
- name: http
port: {{ .Values.kdoctorAgent.httpServer.appHttpPort }}
targetPort: http
protocol: TCP
- name: https
port: {{ .Values.kdoctorAgent.httpServer.appHttpsPort }}
targetPort: https
protocol: TCP
{{- end }}
ipFamilyPolicy: SingleStack
ipFamilies:
- IPv4
selector:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 4 }}
{{- end }}
---
{{- if .Values.feature.enableIPv6 }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "project.kdoctorAgent.serviceIpv6Name" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if or .Values.global.commonAnnotations .Values.kdoctorAgent.service.annotations }}
annotations:
{{- if .Values.global.commonAnnotations }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.kdoctorAgent.service.annotations }}
{{- include "tplvalues.render" ( dict "value" .Values.kdoctorAgent.service.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- if .Values.global.commonLabels }}
{{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- include "project.kdoctorAgent.labels" . | nindent 4 }}
spec:
type: {{ .Values.kdoctorAgent.service.type }}
ports:
{{- if .Values.kdoctorAgent.prometheus.enabled }}
- name: metrics
port: {{ .Values.kdoctorAgent.prometheus.port }}
targetPort: metrics
protocol: TCP
{{- end }}
{{- if .Values.feature.enableIPv6 }}
- name: http
port: {{ .Values.kdoctorAgent.httpServer.appHttpPort }}
targetPort: http
protocol: TCP
- name: https
port: {{ .Values.kdoctorAgent.httpServer.appHttpsPort }}
targetPort: https
protocol: TCP
{{- end }}
ipFamilyPolicy: SingleStack
ipFamilies:
- IPv6
selector:
{{- include "project.kdoctorAgent.selectorLabels" . | nindent 4 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
Expand Down
5 changes: 5 additions & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ global:
## @param global.configName the configmap name
configName: "kdoctor"

configAppTemplate: "kdoctor-app-config-template"


## @section feature parameters
feature:
Expand Down Expand Up @@ -107,6 +109,9 @@ feature:
## @section kdoctorAgent parameters
##
kdoctorAgent:
## @param kdoctorAgent.uniqueMatchLabelKey the unique match label key for Agent
uniqueMatchLabelKey: ""

## @param kdoctorAgent.name the kdoctorAgent name
name: "kdoctor-agent"

Expand Down
Loading
Loading