You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

목차

개요

  • Kubernetes 배포 파일을 작성하고, 배포해 볼 것입니다.

사전조건

Kubernetes 배포 파일 작성

  • deploy/k8s-deploy.yml
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: redis
    spec:
      selector:
        matchLabels:
          app: redis
      replicas: 1
      template:
        metadata:
          labels:
            app: redis
        spec:
          containers:
          - name: redis
            image: redis
            ports:
            - containerPort: 6379
    ---
    apiVersion: apps/v1
    kind: Deployment 
    metadata: 
      name: reactor-demo 
    spec: 
      selector: 
        matchLabels: 
          app: reactor-demo 
      replicas: 3
      template:
        metadata: 
          labels: 
            app: reactor-demo 
        spec: 
          containers: 
          - name: reactor-demo 
            image: sooabia/reactor-demo:1.0
            ports: 
            - containerPort: 8080
    ---  
    kind: Service 
    apiVersion: v1 
    metadata: 
      name: spring-service 
    spec: 
      selector: 
        app: reactor-demo 
      ports: 
      - protocol: TCP 
        port: 80 
        targetPort: 8080
      type: LoadBalancer
  • No labels