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

Resolving Issue of Helm chart #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ RUN npm install --omit=dev

COPY favicon.ico .
COPY *.js ./
RUN npm install --save morgan
RUN npm install --save helmet
RUN npm install --save cors
RUN npm install --save express-rate-limit
RUN npm install --save serve-favicon


CMD [ "node", "index.js" ]

Expand Down
200 changes: 200 additions & 0 deletions charts/cloud-native-weather-nodejs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
apiVersion: v1
data:
POSTGRES_DB: weather
POSTGRES_HOST: weather-database
kind: ConfigMap
metadata:
labels:
app: weather-service
env: dev
framework: nodejs
name: database-configmap-b78hm8dc9b
---
apiVersion: v1
data:
POSTGRES_PASSWORD: MXFheTJ3c3g=
POSTGRES_USER: bm9kZWpz
kind: Secret
metadata:
labels:
app: weather-service
env: dev
framework: nodejs
name: database-secrets-7dtgft72ck
type: Opaque
---
apiVersion: v1
kind: Service
metadata:
labels:
env: dev
type: hoverfly
name: hoverfly
spec:
ports:
- name: proxy
port: 8500
targetPort: 8500
- name: webserver
port: 8888
targetPort: 8888
selector:
env: dev
type: hoverfly
---
apiVersion: v1
kind: Service
metadata:
labels:
env: dev
type: database
name: weather-database
spec:
ports:
- name: "5432"
port: 5432
targetPort: 5432
selector:
env: dev
type: database
---
apiVersion: v1
kind: Service
metadata:
labels:
app: weather-service
env: dev
framework: nodejs
type: microservice
name: weather-service
spec:
ports:
- port: 8085
protocol: TCP
targetPort: http
selector:
app: weather-service
env: dev
framework: nodejs
sessionAffinity: None
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
env: dev
type: hoverfly
name: hoverfly
spec:
replicas: 1
selector:
matchLabels:
env: dev
type: hoverfly
template:
metadata:
labels:
env: dev
type: hoverfly
spec:
containers:
- image: jshaktiraj/go-k8s:0.3.0
name: hoverfly
ports:
- containerPort: 8500
- containerPort: 8888
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
env: dev
type: database
name: weather-database
spec:
replicas: 1
selector:
matchLabels:
env: dev
type: database
template:
metadata:
labels:
env: dev
type: database
spec:
containers:
- envFrom:
- configMapRef:
name: database-configmap-b78hm8dc9b
- secretRef:
name: database-secrets-7dtgft72ck
image: postgres:11.16
imagePullPolicy: IfNotPresent
name: database
ports:
- containerPort: 5432
resources:
limits:
cpu: "0.5"
memory: 256Mi
requests:
cpu: "0.5"
memory: 128Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: weather-service
env: dev
framework: nodejs
type: microservice
name: weather-service
spec:
replicas: 1
selector:
matchLabels:
app: weather-service
env: dev
framework: nodejs
template:
metadata:
labels:
app: weather-service
env: dev
framework: nodejs
spec:
containers:
- envFrom:
- configMapRef:
name: database-configmap-b78hm8dc9b
- secretRef:
name: database-secrets-7dtgft72ck
image: jshaktiraj/go-k8s:0.3.0
livenessProbe:
httpGet:
path: /health/live
port: http
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 1
name: weather-service
ports:
- containerPort: 3000
name: http
readinessProbe:
httpGet:
path: /health/ready
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
resources:
limits:
cpu: "1"
memory: 256Mi
requests:
cpu: "0.5"
memory: 128Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
data:
POSTGRES_DB: weather
POSTGRES_HOST: weather-database
kind: ConfigMap
metadata:
labels:
app: weather-service
env: prod
framework: nodejs
name: database-configmap-b78hm8dc9b
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
data:
POSTGRES_PASSWORD: MXFheTJ3c3g=
POSTGRES_USER: bm9kZWpz
kind: Secret
metadata:
labels:
app: weather-service
env: prod
framework: nodejs
name: database-secrets-7dtgft72ck
type: Opaque
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: weather-service
env: prod
framework: nodejs
type: microservice
name: weather-service
spec:
replicas: 2
selector:
matchLabels:
app: weather-service
env: prod
framework: nodejs
template:
metadata:
labels:
app: weather-service
env: prod
framework: nodejs
spec:
containers:
- envFrom:
- configMapRef:
name: database-configmap-b78hm8dc9b
- secretRef:
name: database-secrets-7dtgft72ck
image: jshaktiraj/go-k8s:0.3.0
livenessProbe:
httpGet:
path: /health/live
port: http
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 1
name: weather-service
ports:
- containerPort: 3000
name: http
readinessProbe:
httpGet:
path: /health/ready
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
resources:
limits:
cpu: "1"
memory: 256Mi
requests:
cpu: "0.5"
memory: 128Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: weather-service
env: prod
framework: nodejs
type: microservice
name: weather-service
spec:
ports:
- port: 8085
protocol: TCP
targetPort: http
selector:
app: weather-service
env: prod
framework: nodejs
sessionAffinity: None
type: LoadBalancer
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
logger: {}
chartname: cloud-native-weather-nodejs
sharedValues:
affinity: {}
nodeSelector: {}
podSecurityContext: {}
resources: {}
securityContext: {}
tolerations: {}
globalConfig:
metadata.labels:
- strategy: newline
key: cloud-native-weather-nodejs.labels
metadata.name:
- strategy: inline
key: cloud-native-weather-nodejs.fullname
fileConfig:
charts/cloud-native-weather-nodejs/-generated/database-configmap-b78hm8dc9b-cm.yaml: {}
charts/cloud-native-weather-nodejs/-generated/database-secrets-7dtgft72ck-secret.yaml: {}
charts/cloud-native-weather-nodejs/-generated/weather-service-deployment.yaml: {}
charts/cloud-native-weather-nodejs/-generated/weather-service-svc.yaml: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: cloud-native-weather-nodejs
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
Loading