Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Update cicd #656

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ac8113b
Create config.yml
petercipriano-ms Oct 4, 2023
9141fc9
Update config.yml
petercipriano-ms Oct 4, 2023
31ca2a0
Create ingress.yml
petercipriano-ms Oct 4, 2023
a59a17f
Update values.yaml
petercipriano-ms Oct 4, 2023
9b4c552
Update config.yml
petercipriano-ms Oct 4, 2023
c856dc9
Update config.yml
petercipriano-ms Oct 4, 2023
a60e581
Update config.yml
petercipriano-ms Oct 4, 2023
d2dda9f
Update config.yml
petercipriano-ms Oct 4, 2023
912694e
Update ingress.yml
petercipriano-ms Oct 4, 2023
3857982
Update ingress.yml
petercipriano-ms Oct 4, 2023
df444e5
Update ingress.yml
petercipriano-ms Oct 4, 2023
cb53196
Update values.yaml
petercipriano-ms Oct 4, 2023
7f000e7
Update ingress.yml
petercipriano-ms Oct 4, 2023
a0d79c5
Update values.yaml
petercipriano-ms Oct 4, 2023
9477360
Update ingress.yml
petercipriano-ms Oct 4, 2023
3b20796
Update ingress.yml
petercipriano-ms Oct 4, 2023
ccbf666
Update config.yml
petercipriano-ms Oct 4, 2023
fb80ecc
Update deployment.yaml
petercipriano-ms Oct 4, 2023
e4c7d1c
Update values.yaml
petercipriano-ms Oct 4, 2023
782af51
Update ingress.yml
petercipriano-ms Oct 4, 2023
a96c22c
Update values.yaml
petercipriano-ms Oct 4, 2023
39bdc7d
Update values.yaml
petercipriano-ms Oct 4, 2023
83b59e3
Update config.yml
petercipriano-ms Oct 4, 2023
aee84be
Update config.yml
petercipriano-ms Oct 4, 2023
2fa40f3
Update deployment.yaml
petercipriano-ms Oct 4, 2023
77e6842
Update config.yml
petercipriano-ms Oct 4, 2023
d0a3d9c
Update values.yaml
petercipriano-ms Oct 4, 2023
e1db290
Update values.yaml
petercipriano-ms Oct 5, 2023
6737342
Update deployment.yaml
petercipriano-ms Oct 5, 2023
7c47a09
Update values.yaml
petercipriano-ms Oct 5, 2023
7cd1874
Update deployment.yaml
petercipriano-ms Oct 5, 2023
7b0ca3b
Update deployment.yaml
petercipriano-ms Oct 5, 2023
0e6acfd
Update service.yaml
petercipriano-ms Oct 5, 2023
8a0c2ab
Update values.yaml
petercipriano-ms Oct 5, 2023
99dbf97
Update values.yaml
petercipriano-ms Oct 5, 2023
6377538
Update service.yaml
petercipriano-ms Oct 5, 2023
416953a
Update values.yaml
petercipriano-ms Oct 5, 2023
4702907
Update config.yml
petercipriano-ms Oct 5, 2023
4710d83
Update ingress.yml
petercipriano-ms Oct 9, 2023
a4ea25c
Update ingress.yml
petercipriano-ms Oct 10, 2023
de932c3
Update config.yml
petercipriano-ms Jan 30, 2024
aab5c2a
Update config.yml
petercipriano-ms Jan 30, 2024
c6bc9bc
Update config.yml
petercipriano-ms Jan 30, 2024
36b7947
Rename values.yaml to values-dev.yaml
petercipriano-ms Jan 30, 2024
24b68c9
Create values-prod.yml
petercipriano-ms Jan 30, 2024
e371c28
Update config.yml
petercipriano-ms Jan 30, 2024
02cfc0b
Rename values-prod.yml to values-prod.yaml
petercipriano-ms Jan 30, 2024
7579022
Update ingress.yml
petercipriano-ms Feb 16, 2024
c026b7f
Update values-prod.yaml
petercipriano-ms Feb 16, 2024
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
97 changes: 97 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
version: 2.1
orbs:
moneysmart-orb: moneysmartco/[email protected]
aws-cli: circleci/[email protected]
helm: circleci/[email protected]
defaults: &defaults
working_directory: ~/app
docker:
# the Docker image with Cypress dependencies
- image: cypress/base:16.14.0
environment:
## this enables colors in the output
TERM: xterm
aliases:
- &prod_aws_creds
aws-cli/setup:
aws-access-key-id: AWS_ACCESS_KEY
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
aws-region: AWS_REGION
- &stg_aws_creds
aws-cli/setup:
aws-access-key-id: STAGING_AWS_ACCESS_KEY
aws-secret-access-key: STAGING_AWS_SECRET_ACCESS_KEY
aws-region: AWS_REGION
default-image: &default-image
machine:
image: ubuntu-2004:current
docker_layer_caching: true
jobs:
deploy_to_sg_staging_eks:
docker:
- image: 'cimg/python:3.10'
steps:
- checkout
- *stg_aws_creds
- attach_workspace:
at: /tmp/workspace
- moneysmart-orb/pull_helm_charts:
cluster-name: product-listing-staging
chart-name: kafka-rest
branch-name: production
- helm/upgrade-helm-chart:
chart: charts/cp-kafka-rest
release-name: kafka-rest-sg
namespace: kafka-client
values-to-override: appLabels.region=sg
values: charts/cp-kafka-rest/values-dev.yaml
timeout: 600s
helm-version: v3.9.0
#---------------------------------------------
# kakfa-rest SG and
#--------------------------------------------
deploy_to_sg_prod_eks:
docker:
- image: 'cimg/python:3.10'
steps:
- checkout
- *prod_aws_creds
- attach_workspace:
at: /tmp/workspace
- moneysmart-orb/pull_helm_charts:
cluster-name: product-listing-prod
chart-name: kafka-rest
branch-name: production
- helm/upgrade-helm-chart:
chart: charts/cp-kafka-rest
release-name: kafka-rest-sg
namespace: kafka-client
values-to-override: appLabels.region=sg
values: charts/cp-kafka-rest/values-prod.yaml
timeout: 600s
helm-version: v3.9.0
workflows:
version: 2.1
#---------------------------------------------
# kafka-rest SG and HK Staging Pipeline
#---------------------------------------------
staging-build-deploy:
jobs:
- deploy_to_sg_prod_eks:
context: common-eks-vars
filters:
branches:
only:
- update-cicd
#---------------------------------------------
# campaign_service SG and HK Production Pipeline
#---------------------------------------------
prod-build-deploy:
jobs:
- deploy_to_sg_prod_eks:
context: common-eks-vars
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
9 changes: 9 additions & 0 deletions charts/cp-kafka-rest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
{{- end }}
- name: {{ template "cp-kafka-rest.name" . }}-server
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
command: ["/bin/bash", "-c"]
args: ["kafka-rest-start /etc/kafka-rest-cloud/kafka-rest.properties"]
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
ports:
- name: rest-proxy
Expand All @@ -67,6 +69,10 @@ spec:
- containerPort: {{ .Values.jmx.port }}
name: jmx
{{- end }}
volumeMounts:
- name: kafka-rest-config
mountPath: /etc/kafka-rest-cloud/
readOnly: true
resources:
{{ toYaml .Values.resources | indent 12 }}
env:
Expand Down Expand Up @@ -102,6 +108,9 @@ spec:
configMap:
name: {{ template "cp-kafka-rest.fullname" . }}-jmx-configmap
{{- end }}
- name: kafka-rest-config
secret:
secretName: kafka-rest-config
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
31 changes: 31 additions & 0 deletions charts/cp-kafka-rest/templates/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- $fullName := include "cp-kafka-rest.fullname" . -}}
{{- $ingressPath := .Values.envs.kafka_rest.paths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.envs.kafka_rest.certificate_arn }}
alb.ingress.kubernetes.io/group.name: eks-lb-{{ .Values.appLabels.region }}
alb.ingress.kubernetes.io/healthcheck-path: /_ping
alb.ingress.kubernetes.io/group.order: '150'
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/use-regex: "true"
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Release.Name }}
region: {{ .Values.appLabels.region }}
name: {{ .Release.Name }}
spec:
rules:
- host: event-proxy.{{ .Values.domain }}
http:
paths:
{{- range $ingressPath }}
- path: {{ . }}
backend:
service:
name: {{ $fullName }}
port:
number: 8082
pathType: ImplementationSpecific
{{- end }}
1 change: 1 addition & 0 deletions charts/cp-kafka-rest/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ spec:
selector:
app: {{ template "cp-kafka-rest.name" . }}
release: {{ .Release.Name }}
type: {{ .Values.serviceType }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Default values for cp-kafka-rest.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
envs:
kafka_rest:
ingress_host: event-proxy.mssgdev.com
name: kafka-client
certificate_arn: arn:aws:acm:ap-southeast-1:856075066843:certificate/3d8d374c-c52f-4e59-8deb-e5b44c615db3
paths:
- /*

replicaCount: 1

Expand All @@ -19,6 +26,7 @@ imagePullPolicy: IfNotPresent
imagePullSecrets:

servicePort: 8082
serviceType: NodePort

## Kafka rest JVM Heap Option
heapOptions: "-Xms512M -Xmx512M"
Expand Down Expand Up @@ -92,12 +100,12 @@ external:
## If the Kafka Chart is disabled a URL of zookeeper are required to connect
## e.g. ungaged-sparrow-cp-zookeeper:2181
cp-zookeeper:
url: ""
url: "z-1.mskproductlisting.cya0qq.c3.kafka.ap-southeast-1.amazonaws.com:2181"

## If the Kafka Chart is disabled a URL and port are required to connect
## e.g. gnoble-panther-cp-schema-registry:8081
cp-schema-registry:
url: ""

cp-kafka:
bootstrapServers: ""
bootstrapServers: "b-2.mskproductlisting.cya0qq.c3.kafka.ap-southeast-1.amazonaws.com:9096,b-1.mskproductlisting.cya0qq.c3.kafka.ap-southeast-1.amazonaws.com:9096"
113 changes: 113 additions & 0 deletions charts/cp-kafka-rest/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Default values for cp-kafka-rest.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
envs:
kafka_rest:
ingress_host: event-proxy.moneysmart.sg
name: kafka-client
certificate_arn: arn:aws:acm:ap-southeast-1:814507470717:certificate/989bd44a-305f-47ab-acb9-574fd7a4dd9e
paths:
- /*

replicaCount: 1

domain: moneysmart.sg

## Image Info
## ref: https://hub.docker.com/r/confluentinc/cp-kafka/
image: confluentinc/cp-kafka-rest
imageTag: 6.1.0

## Specify a imagePullPolicy
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
imagePullPolicy: IfNotPresent

## Specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
imagePullSecrets:

servicePort: 8082
serviceType: NodePort

## Kafka rest JVM Heap Option
heapOptions: "-Xms512M -Xmx512M"

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

## Custom pod annotations
podAnnotations: {}

## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
nodeSelector: {}

## Taints to tolerate on node assignment:
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Pod scheduling constraints
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Kafka REST configuration options
## ref: https://docs.confluent.io/current/kafka-rest/docs/config.html
configurationOverrides:
# "consumer.request.timeout.ms": 5000

## Additional env variables
customEnv: {}
# ZOOKEEPER_SASL_ENABLED: "false"

## Monitoring
## Kafka REST JMX Settings
## ref: https://docs.confluent.io/current/kafka-rest/docs/monitoring.html
jmx:
port: 5555

## Prometheus Exporter Configuration
## ref: https://prometheus.io/docs/instrumenting/exporters/
prometheus:
## JMX Exporter Configuration
## ref: https://github.com/prometheus/jmx_exporter
jmx:
enabled: true
image: solsson/kafka-prometheus-jmx-exporter@sha256
imageTag: 6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143
imagePullPolicy: IfNotPresent
port: 5556

## Resources configuration for the JMX exporter container.
## See the `resources` documentation above for details.
resources: {}

## External Access
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer
external:
enabled: false
type: LoadBalancer
externalTrafficPolicy: Cluster
port: 8082

## If the Kafka Chart is disabled a URL of zookeeper are required to connect
## e.g. ungaged-sparrow-cp-zookeeper:2181
cp-zookeeper:
url: "z-1.mskproductlisting.x95avm.c3.kafka.ap-southeast-1.amazonaws.com:2181"

## If the Kafka Chart is disabled a URL and port are required to connect
## e.g. gnoble-panther-cp-schema-registry:8081
cp-schema-registry:
url: ""

cp-kafka:
bootstrapServers: "b-1.mskproductlisting.x95avm.c3.kafka.ap-southeast-1.amazonaws.com:9096,b-2.mskproductlisting.x95avm.c3.kafka.ap-southeast-1.amazonaws.com"