标签:docke secret ada UNC dock b2c class match deploy
1 kind: pipeline 2 name: default 3 steps: 4 - name: test 5 image: python:3.7-alpine 6 commands: 7 - "python test.py" 8 9 # - name: publish 10 # image: plugins/docker 11 # settings: 12 # mirror: https://cm2sd473.mirror.aliyuncs.com 13 # repo: registry:5000/flask 14 # registry: registry:5000 15 # insecure: true 16 # tags: [ "${DRONE_COMMIT_SHA:0:7}","latest" ] 17 # password: 18 # from_secret: docker_password 19 # username: 20 # from_secret: docker_username 21 22 - name: deliver 23 image: sinlead/drone-kubectl 24 network_mode: bridge 25 environment: 26 PLUGIN_KUBERNETES_SERVER: https://minikube:8443 27 PLUGIN_KUBERNETES_USER: minikube 28 # PLUGIN_KUBERNETES_TOKEN: minikube 29 # PLUGIN_KUBERNETES_CERT: minikube 30 settings: 31 mirror: https://cm2sd473.mirror.aliyuncs.com 32 kubernetes_server: 33 from_secret: k8s_server 34 kubernetes_cert: 35 from_secret: k8s_cert 36 kubernetes_token: 37 from_secret: k8s_token 38 commands: 39 # - env 40 - kubectl config view 41 - kubectl version --short 42 # - kubectl create deployment flask-deployment --image=localhost:5000/flask:latest --output=yaml 43 - kubectl apply -f deployment.yml
1 FROM python:3.7-alpine 2 WORKDIR /app 3 COPY requirements.txt /app 4 RUN pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 5 COPY . /app 6 ENTRYPOINT ["python3"] 7 CMD ["app.py"]
1 from flask import Flask 2 app = Flask(__name__) 3 4 @app.route(‘/‘) 5 def hello(): 6 return "Hello World!" 7 8 if __name__ == ‘__main__‘: 9 app.run(host=‘0.0.0.0:8081‘)
1 apiVersion: apps/v1 2 kind: Deployment 3 metadata: 4 name: flask-deployment 5 labels: 6 app: flask 7 spec: 8 replicas: 3 9 selector: 10 matchLabels: 11 app: flask 12 template: 13 metadata: 14 labels: 15 app: flask 16 spec: 17 containers: 18 - name: flask 19 image: registry:5000/flask:latest 20 ports: 21 - containerPort: 80
1 version: ‘3‘ 2 services: 3 web: 4 build: app 5 ports: 6 - ‘5000:5000‘
1 flask
1 print(‘hello, python!test‘)
标签:docke secret ada UNC dock b2c class match deploy
原文地址:https://www.cnblogs.com/kulou/p/13881416.html