Skip to content

Commit

Permalink
Merge pull request #252 from accuknox/feature-dev
Browse files Browse the repository at this point in the history
updated-config
  • Loading branch information
nareshpandianpc committed Aug 2, 2021
2 parents 4b1b46c + d74bb84 commit 4a8dc6c
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 110 deletions.
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pipelineExecute app_config: 'resources/build-info.yaml',
dev_branch: "dev",
verify_branch: "verify",
prod_branch: "prod",
deployment_configs: "deployment",
jenkins_node_label: "jenkins-slave-01"
jenkins_node_label: "jenkins-slave-02"
2 changes: 1 addition & 1 deletion deployments/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: knoxautopolicy
name: {{ .Values.labels.app }}
labels:
deployment: knoxautopolicy
spec:
Expand Down
22 changes: 14 additions & 8 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: knoxautopolicy
name: {{ .Values.labels.app }}
labels:
deployment: knoxautopolicy
{{ toYaml .Values.labels | indent 4 }}
spec:
selector:
matchLabels:
container: knoxautopolicy
container: {{ .Values.labels.app }}
template:
metadata:
labels:
container: knoxautopolicy
container: {{ .Values.labels.app }}
annotations:
checksum.helm.kubernetes.io/configmap: {{ include (print $.Chart.Name "/templates/dev-config.yaml") . | sha256sum }}
checksum.helm.kubernetes.io/secret: {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}
spec:
imagePullSecrets:
containers:
- image: "{{ .Values.knoxautopolicy.image.repository }}:{{ .Values.knoxautopolicy.image.tag | default .Chart.AppVersion }}"
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
name: knoxautopolicy
ports:
- containerPort: 9089
protocol: TCP
volumeMounts:
{{- toYaml .Values.volumeMounts | nindent 12 }}
volumes:
{{- toYaml .Values.volumes | nindent 12 }}
{{ toYaml .Values.volumeMounts | indent 10 }}
resources:
{{ toYaml .Values.volumes | indent 10 }}
volumes:
{{ toYaml .Values.resources | indent 8 }}
2 changes: 1 addition & 1 deletion helm/templates/dev-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: knoxautopolicy-config
name: {{ .Values.labels.app }}-config
#namespace: {{ .Release.Namespace }}
data:
conf.yaml: |-
Expand Down
33 changes: 33 additions & 0 deletions helm/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.labels.app }}
labels:
{{ toYaml .Values.labels | indent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.labels.app }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}

{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
12 changes: 6 additions & 6 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: knoxautopolicy
name: {{ .Values.labels.app }}-service
labels:
service: knoxautopolicy
{{ toYaml .Values.labels | indent 4 }}
spec:
ports:
- port: 9089
targetPort: 9089
protocol: TCP
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }} # Port in microservice
protocol: {{ .Values.service.protocol }}
selector:
container: knoxautopolicy
app: {{ .Values.labels.app }}
37 changes: 18 additions & 19 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
# Declare variables to be passed into your templates.

replicaCount: 1
knoxautopolicy:
image:
repository: us.gcr.io/mimetic-kit-294408/accuknox-agents/dev/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

image:
repository: agents.accuknox.com/repository/docker-dev/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

labels:
app: knoxautopolicy
env: dev

namespace: accuknox-dev-knoxautopolicy

Expand Down Expand Up @@ -70,21 +74,16 @@ ingress:
# hosts:
# - chart-example.local


resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
requests:
cpu: 400m
memory: 450Mi
limits:
cpu: 200m
memory: 250Mi

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
Expand Down
39 changes: 19 additions & 20 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
# Declare variables to be passed into your templates.

replicaCount: 1
knoxautopolicy:
image:
repository: gcr.io/mimetic-kit-294408/prod/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

image:
repository: agents.accuknox.com/repository/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

labels:
app: knoxautopolicy
env: prod

namespace: accuknox-prod-knoxautopolicy

Expand Down Expand Up @@ -65,21 +69,16 @@ ingress:
# hosts:
# - chart-example.local


resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
requests:
cpu: 400m
memory: 450Mi
limits:
cpu: 200m
memory: 250Mi

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
Expand Down Expand Up @@ -133,7 +132,7 @@ config:
broker-address-family: v4
session-timeout-ms: 6000
auto-offset-reset: "earliest"
bootstrap-servers: "dev-kafka-kafka-bootstrap.accuknox-dev-kafka.svc.cluster.local:9092"
bootstrap-servers: "accuknox-prod-kafka-kafka-bootstrap.accuknox-prod-kafka.svc.cluster.local:9092"
group-id: policy.cilium
topics:
- cilium-telemetry
Expand Down
40 changes: 20 additions & 20 deletions helm/values-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
# Declare variables to be passed into your templates.

replicaCount: 1
knoxautopolicy:
image:
repository: gcr.io/mimetic-kit-294408/verify/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

image:
repository: agents.accuknox.com/repository/docker-verify/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

labels:
app: knoxautopolicy
env: verify

namespace: accuknox-verify-knoxautopolicy

Expand Down Expand Up @@ -66,24 +70,20 @@ ingress:
# - chart-example.local


resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
requests:
cpu: 400m
memory: 450Mi
limits:
cpu: 200m
memory: 250Mi

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80

nodeSelector: {}

Expand Down Expand Up @@ -133,7 +133,7 @@ config:
broker-address-family: v4
session-timeout-ms: 6000
auto-offset-reset: "earliest"
bootstrap-servers: "dev-kafka-kafka-bootstrap.accuknox-dev-kafka.svc.cluster.local:9092"
bootstrap-servers: "accuknox-verify-kafka-kafka-bootstrap.accuknox-verify-kafka.svc.cluster.local:9092"
group-id: policy.cilium
topics:
- cilium-telemetry
Expand Down
43 changes: 21 additions & 22 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Default values for helm.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1
knoxautopolicy:
image:
repository: gcr.io/mimetic-kit-294408/snapshot/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "1.0"

image:
repository: gcr.io/accuknox/dev/knoxautopolicy
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: ""

labels:
app: knoxautopolicy
env: dev

namespace: accuknox-dev-knoxautopolicy

Expand Down Expand Up @@ -49,8 +52,9 @@ securityContext: {}
# runAsUser: 1000

service:
type: ClusterIP
port: 9089
targetPort: 9089
protocol: TCP

ingress:
enabled: false
Expand All @@ -65,25 +69,20 @@ ingress:
# hosts:
# - chart-example.local


resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources:
requests:
cpu: 200m
memory: 250Mi
limits:
cpu: 400m
memory: 450Mi

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80

nodeSelector: {}

Expand Down

0 comments on commit 4a8dc6c

Please sign in to comment.