Last active
August 12, 2021 19:04
-
-
Save BrianMehrman/591808edc0c7e1cf7a5d754ffbac3700 to your computer and use it in GitHub Desktop.
These are instructions to start a mongo db deployment. Assuming these files are all in the same directory you can run this ``` kubectl apply -k . ```
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: mongo-configmap | |
labels: | |
app: meal-plan-app | |
component: mongo-db | |
data: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: rootR0xks |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mongo-db | |
labels: | |
app: meal-plan-app | |
component: mongo-db | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: meal-plan-app | |
component: mongo-db | |
template: | |
metadata: | |
labels: | |
app: meal-plan-app | |
component: mongo-db | |
spec: | |
containers: | |
- name: mongo-db | |
image: mongo:4.0 | |
command: | |
- mongod | |
resources: | |
requests: | |
memory: "64Mi" | |
cpu: "250m" | |
limits: | |
memory: "256Mi" | |
cpu: "500m" | |
envFrom: | |
- configMapRef: | |
name: mongo-configmap |
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
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
resources: | |
- configmap.yaml | |
- deployment.yaml | |
- service.yaml |
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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: mongo-db | |
spec: | |
selector: | |
app: meal-plan-app | |
component: mongo-db | |
type: NodePort | |
ports: | |
- name: db | |
port: 27017 | |
targetPort: 27017 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment