apiVersion: v1
kind: Pod
metadata:
name: nodehelloworld.example.com
labels:
app: helloworld
spec:
containers:
- name: devopsschool1
image: scmgalaxy/nginx-devopsschoolv1
ports:
- name: nginx-port
containerPort: 80
apiVersion: v1
kind: Pod
metadata:
name: mysql-pod
labels:
name: mysql-pod
context: docker-k8s-lab
spec:
containers:
- name: mysql
image: mysql:latest
env:
- name: "MYSQL_USER"
value: "mysql"
- name: "MYSQL_PASSWORD"
value: "mysql"
- name: "MYSQL_DATABASE"
value: "sample"
- name: "MYSQL_ROOT_PASSWORD"
value: "supersecret"
ports:
- containerPort: 3306
# POD.YAML
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
# Just spin & wait forever
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
apiVersion: v1
kind: Pod
metadata:
name: nodehelloworld.example.com
labels:
app: helloworld
spec:
containers:
- name: k8s-demo
image: wardviaene/k8s-demo
ports:
- name: nodejs-port
containerPort: 3000
apiVersion: v1
kind: Service
metadata:
name: helloworld-service
spec:
ports:
- port: 31001
nodePort: 31001
targetPort: nodejs-port
protocol: TCP
selector:
app: helloworld
type: NodePort
apiVersion: v1
kind: Service
metadata:
name: helloworld-service
spec:
ports:
- port: 80
targetPort: nodejs-port
protocol: TCP
selector:
app: helloworld
type: LoadBalancer
apiVersion: v1
kind: Pod
metadata:
name: helloworld-nginx
labels:
app: helloworld-nginx
spec:
containers:
- name: nginx
image: nginx:1.11
ports:
- containerPort: 80
volumeMounts:
- name: config-volume
mountPath: /etc/nginx/conf.d
- name: k8s-demo
image: wardviaene/k8s-demo
ports:
- containerPort: 3000
volumes:
- name: config-volume
configMap:
name: nginx-config
items:
- key: reverseproxy.conf
path: reverseproxy.conf
kind: Pod
metadata:
name: nodehelloworld.example.com
labels:
app: helloworld
spec:
containers:
- name: k8s-demo
image: wardviaene/k8s-demo
ports:
- name: nodejs-port
containerPort: 3000
apiVersion: v1
kind: Pod
metadata:
name: hello-pod
spec:
containers:
- name: hello-ctr
image: nginx
ports:
- containerPort: 80
labels:
- app: hello-world
apiVersion: v1
kind: Pod
metadata:
name: pod-example
spec:
containers:
- name: ubuntu
image: ubuntu:trusty
command: ["echo"]
args: ["Hello World"]
## Sample Pod YAML file used in example :
apiVersion: v1
kind: Pod
metadata:
name: hello-pod
spec:
containers:
- name: hello-ctr
image: nigelpoulton/pluralsight-docker-ci:latest
ports:
- containerPort: 8080
Kubernetes – CKA Certification | Part 1 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 2 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 3 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 4 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 5 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 6 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 7 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 8 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 9 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 10 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 11 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 12 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 13 out 14 | — By DevOpsSchool
Kubernetes – CKA Certification | Part 14 out 14 | — By DevOpsSchool
Latest posts by Rajesh Kumar (see all)
- Discover the Heart of India with Mera Apna Bihar - December 20, 2024
- Experience the Pulse of Bangalore with Bangalore Orbit - December 20, 2024
- Discover the City of Lakes with Bhopal Orbit - December 20, 2024