Last active
March 18, 2018 06:29
-
-
Save Subv/172fa8f4f539c5dcc4c50b42edb3b43f to your computer and use it in GitHub Desktop.
Kubernetes Deployments
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
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: mysql-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: mysql | |
replicas: 1 | |
template: # create pods using pod definition in this template | |
metadata: | |
labels: | |
app: mysql | |
spec: | |
containers: | |
- name: mysql | |
image: mysql:5.7 | |
ports: | |
- containerPort: 3306 | |
# env sets environment variables in the container | |
# exactly like environment variables set from the command line | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
value: "12345" | |
- name: MYSQL_DATABASE | |
value: "operaciones" |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mysql-service | |
labels: | |
app: mysql-service | |
spec: | |
ports: | |
- port: 3306 | |
targetPort: 3306 | |
protocol: TCP | |
selector: | |
app: mysql |
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
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: php-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: php | |
replicas: 1 | |
template: # create pods using pod definition in this template | |
metadata: | |
labels: | |
app: php | |
spec: | |
containers: | |
- name: php | |
image: subv/plataformasdesarrollo:phpdemo_v3 | |
ports: | |
- containerPort: 80 |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: php-service | |
labels: | |
app: php-service | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 80 | |
protocol: TCP | |
selector: | |
app: php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment