标签:.com font processor 一个 size 防火墙 ice keyword containe
参考 《kubernetes 权威指南》一节的 从一个简单例子开始,操作实录。
一、Java Web 应用结构
apiVersion: v1
kind: ReplicationController
metadata:
name: mysql
spec:
replicas: 1
selector:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "123456"
# kubectl create -f mysql-rc.yaml
#
kubectl get rc
#kubectl get pods
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
ports:
- port: 3306
selector:
app: mysql
# kubectl create -f mysql-svc.yaml
# kubectl get svc
apiVersion: v1
kind: ReplicationController
metadata:
name: myweb
spec:
replicas: 1
selector:
app: myweb
template:
metadata:
labels:
app: myweb
spec:
containers:
- name: myweb
image: kubeguide/tomcat-app:v1
ports:
- containerPort: 8080
# kubectl create -f myweb-rc.yaml
# kubectl get pod
kind: Service
metadata:
name: myweb
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30002
selector:
app: myweb
# kubectl create -f myweb-svc.yaml
# kubectl get svc
防火墙需要提前关闭:
systemctl stop firewalld
标签:.com font processor 一个 size 防火墙 ice keyword containe
原文地址:https://www.cnblogs.com/521football/p/10383635.html