Created
November 28, 2019 05:28
-
-
Save cary205/274149fa96b0643fc2977720a2a06f62 to your computer and use it in GitHub Desktop.
kube
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 | |
kind: Deployment | |
metadata: | |
name: hello-deployment | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: my-deployment | |
template: | |
metadata: | |
labels: | |
app: my-deployment | |
spec: | |
containers: | |
- name: my-pod | |
image: zxcvbnius/docker-demo:latest | |
ports: | |
- containerPort: 3000 |
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: Pod | |
metadata: | |
name: my-pod | |
labels: | |
app: webserver | |
spec: | |
containers: | |
- name: pod-demo | |
image: zxcvbnius/docker-demo | |
ports: | |
- containerPort: 3000 |
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: ReplicationController | |
metadata: | |
name: my-replication-controller | |
spec: | |
replicas: 4 | |
selector: | |
app: hello-pod-v1 | |
template: | |
metadata: | |
labels: | |
app: hello-pod-v1 | |
spec: | |
containers: | |
- name: my-pod | |
image: zxcvbnius/docker-demo | |
ports: | |
- containerPort: 3000 |
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: hello-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 3000 | |
nodePort: 30390 | |
protocol: TCP | |
targetPort: 3000 | |
selector: | |
app: my-deployment |
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 | |
kind: Deployment | |
metadata: | |
name: wordpress-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: wordpress-deployment | |
template: | |
metadata: | |
labels: | |
app: wordpress-deployment | |
spec: | |
containers: | |
- name: wordpress | |
image: wordpress:4-php7.0 | |
ports: | |
- name: wordpress-port | |
containerPort: 80 | |
env: | |
- name: WORDPRESS_DB_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: wordpress-secret | |
key: db-password | |
- name: WORDPRESS_DB_HOST | |
value: 127.0.0.1 | |
- name: mysql | |
image: mysql:5.7 | |
ports: | |
- name: mysql-port | |
containerPort: 3306 | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: wordpress-secret | |
key: db-password |
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: Secret | |
metadata: | |
name: wordpress-secret | |
type: Opaque | |
data: | |
# echo -n "rootpass" | base64 | |
db-password: cm9vdHBhc3M= |
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: wordpress-service | |
spec: | |
ports: | |
- port: 3000 | |
nodePort: 30300 | |
protocol: TCP | |
targetPort: wordpress-port | |
selector: | |
app: wordpress-deployment | |
type: NodePort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment