pod,delpoyment,service
< 返回列表时间: 2019-02-27来源:OSCHINA
pod.yaml apiVersion: v1 kind: Pod metadata: name: two-containers labels: label1: ok label2: nok annotations: label3: good label4: nogood namespace: mynamespace spec: restartPolicy: Always containers: #--------------------swarm service-------------------# - name: swarm-container-name0 image: 192.168.175.143:5000/swarm:0.0 imagePullPolicy: Always ports: - name: exposeport containerPort: 9090 hostPort: 9090 env: - name: sex value: boy - name: addr value: guangzhou volumeMounts: - mountPath: /root/test readOnly: true name: mountfunction #--------------------swarm service--------------------# #--------------------jenkins service------------------# - name: jenkins-container-name1 image: 192.168.175.143:5000/android:0.2 imagePullPolicy: Always ports: - containerPort: 8083 hostPort: 8083 - containerPort: 22 hostPort: 2222 volumeMounts: - mountPath: /home/jenkins/.jenkins readOnly: false name: share-data #--------------------jenkins service------------------# #--------------------common setting-------------------# volumes: - name: share-data nfs: server: 192.168.175.143 path: "/home/ubuntu/jenkins/JENKINS_HOME" - name: mountfunction hostPath: path: "/home/ubuntu/STU" nodeSelector: slave: "146" dnsPolicy: "None" dnsConfig: nameservers: - 8.8.8.8 - 10.192.27.32 - 10.192.33.32 #--------------------common setting-------------------#
deployment_python_http.yml apiVersion: apps/v1 kind: Deployment metadata: name: service-test-1 spec: replicas: 3 selector: matchLabels: app: service_test_pod1 template: metadata: labels: app: service_test_pod1 spec: containers: - name: simple-http image: 192.168.175.149:5000/swarm:0.0 imagePullPolicy: IfNotPresent ports: - name: http containerPort: 9090 hostPort: 7777
nginx-deploy-v1.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: 192.168.175.143:5000/nginx:0.0 ports: - name: expose-port containerPort: 80
热门排行