forked from Sunagatov/Iced-Latte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kubernetes yaml file for mongodb and online-store-app were added.
- Loading branch information
Showing
2 changed files
with
66 additions
and
17 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,47 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: mongo-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 256Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mongo | ||
spec: | ||
selector: | ||
app: mongo | ||
ports: | ||
- port: 27017 | ||
targetPort: 27017 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mongo | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mongo | ||
template: | ||
metadata: | ||
labels: | ||
app: mongo | ||
spec: | ||
containers: | ||
- name: mongo | ||
image: mongo:3.6.17-xenial | ||
ports: | ||
- containerPort: 27017 | ||
volumeMounts: | ||
- name: storage | ||
mountPath: /data/db | ||
volumes: | ||
- name: storage | ||
persistentVolumeClaim: | ||
claimName: mongo-pvc |
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 |
---|---|---|
@@ -1,33 +1,35 @@ | ||
apiVersion: v1 # Kubernetes API version | ||
kind: Service # Kubernetes resource kind we are creating | ||
metadata: # Metadata of the resource kind we are creating | ||
name: online-store-app-service | ||
spec: | ||
selector: | ||
app: online-store-app | ||
ports: | ||
- protocol: "TCP" | ||
port: 8083 # The port that the service is running on in the cluster | ||
targetPort: 8083 # The port exposed by the service | ||
type: LoadBalancer # type of the service. LoadBalancer indicates that our service will be external. | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment # Kubernetes resource kind we are creating | ||
metadata: | ||
name: online-store-app | ||
spec: | ||
replicas: 1 # Number of replicas that will be created for this deployment | ||
selector: | ||
matchLabels: | ||
app: online-store-app | ||
replicas: 1 # Number of replicas that will be created for this deployment | ||
template: | ||
metadata: | ||
labels: | ||
app: online-store-app | ||
spec: | ||
containers: | ||
- name: online-store | ||
image: zufarexplainedit/online-store:0.0.1 # Image that will be used to containers in the cluster | ||
imagePullPolicy: IfNotPresent | ||
image: zufarexplainedit/online-store:0.0.2 # Image that will be used to containers in the cluster | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8083 # The port that the container is running on in the cluster | ||
- containerPort: 8083 # The port that the container is running on in the cluster | ||
env: | ||
- name: MONGO_URL | ||
value: mongodb://mongo:27017/dev | ||
--- | ||
apiVersion: v1 # Kubernetes API version | ||
kind: Service # Kubernetes resource kind we are creating | ||
metadata: # Metadata of the resource kind we are creating | ||
name: online-store-app-service | ||
spec: | ||
selector: | ||
app: online-store-app | ||
ports: | ||
- protocol: TCP | ||
port: 8083 # The port that the service is running on in the cluster | ||
targetPort: 8083 # The port exposed by the service |