Forked from robrich/memsql-cluster-in-a-box-kubernetes.yaml
Created
August 10, 2021 08:32
-
-
Save AlexRogalskiy/c0b5af4add8b9b71271524137249cdbf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # A deployment ensures pod(s) are restarted on failure | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: memsql | |
| spec: | |
| replicas: 1 # only create one pod (container) | |
| selector: | |
| matchLabels: | |
| app: memsql | |
| template: | |
| # Here's the definition of the pod: | |
| metadata: | |
| # The service finds all pods with matching metadata | |
| labels: | |
| app: memsql | |
| spec: | |
| containers: | |
| - name: memsql | |
| resources: | |
| # Cluster-in-a-box image is pulled from Docker Hub | |
| image: memsql/cluster-in-a-box | |
| ports: | |
| - containerPort: 3306 # MemSQL db | |
| - containerPort: 8080 # MemSQL Studio | |
| env: | |
| # 'Y' means keep running after cluster init | |
| - name: START_AFTER_INIT | |
| value: 'Y' | |
| # TODO: set to your desired password | |
| - name: ROOT_PASSWORD | |
| value: 'password' | |
| # TODO: paste your license key from portal.memsql.com here: | |
| - name: LICENSE_KEY | |
| value: PASTE_YOUR_LICENSE_KEY_HERE | |
| --- | |
| # A service load-balances across and routes traffic into pods | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: memsql | |
| labels: | |
| app: memsql | |
| spec: | |
| type: NodePort | |
| # Find all pods | |
| selector: | |
| app: memsql | |
| ports: | |
| # MemSQL db port: | |
| - name: '3306' | |
| nodePort: 30306 | |
| port: 3306 | |
| targetPort: 3306 | |
| # MemSQL Studio port: | |
| - name: '8080' | |
| nodePort: 30080 | |
| port: 8080 | |
| targetPort: 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment