-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from rishops/basic-mircoservice-chart
feat: add basic helm chart for ms deployment
- Loading branch information
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v2 | ||
name: microservice | ||
description: A Helm chart for a microservice in Kubernetes | ||
|
||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Basic Helm Template for Deploying Microservice on K8s | ||
|
||
## Chart Structure | ||
``` | ||
microservice/ | ||
├── Chart.yaml | ||
├── values.yaml | ||
├── charts/ | ||
└── templates/ | ||
├── deployment.yaml | ||
└── service.yaml | ||
``` | ||
|
||
## Usage | ||
|
||
You can change the Docker image by modifying the values.yaml file. For example, to use a different image, update the `image.repository` and `image.tag` fields. | ||
|
||
The Helm chart is specifically for deploying a microservice with a Kubernetes service and deployment. You can further customize and expand this chart as needed for your application. | ||
|
||
## Installing the Chart on K8s | ||
|
||
```bash | ||
helm install my-release microservice/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "microservice.fullname" . }} | ||
labels: | ||
{{- include "microservice.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "microservice.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "microservice.selectorLabels" . | nindent 8 }} | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "microservice.fullname" . }} | ||
labels: | ||
{{- include "microservice.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "microservice.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
replicaCount: 1 | ||
|
||
image: | ||
repository: nginx # your microservice image name | ||
pullPolicy: IfNotPresent | ||
tag: "latest" # your microservice image tag | ||
|
||
service: | ||
type: ClusterIP | ||
port: 80 |