开通容器服务
开通前
开通并创建集群后(这里使用按量付费的ECS机器,测试后即可释放)
配置节点完成后
配置无状态应用
一开始我是直接使用的 yaml 进行创建
apiVersion: apps/v1kind: Deploymentmetadata:labels:app: nginxname: nginx-deployment-basicnamespace: defaultspec:progressDeadlineSeconds: 600replicas: 1revisionHistoryLimit: 10selector:matchLabels:app: nginxstrategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdatetemplate:metadata:labels:app: nginxspec:containers:- image: 'nginx:1.7.9'imagePullPolicy: IfNotPresentname: nginxports:- containerPort: 80protocol: TCPreadinessProbe:failureThreshold: 3httpGet:path: /port: 80scheme: HTTPinitialDelaySeconds: 10periodSeconds: 10successThreshold: 1timeoutSeconds: 1resources: {}terminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30
结果是 failure , 因为我是VPC网络并且没有开通SLB和弹性IP,所以拉不下来镜像.
开通NAT网关

开通需要在NAT网关上添加SNAT条目,绑定ECS/交换机走NAT网关的流量进出

绑定时发现需要先申请弹性IP.
