본문 바로가기
[Kubernetes]

sample devops end to end project v1- devops project | ci/cd declarative pipeline using devops tools

by METAVERSE STORY 2023. 7. 22.
반응형

 

 

 

 

 

 

 

 

https://github.com/jmstechhome8/web_login_automation

 

GitHub - jmstechhome8/web_login_automation

Contribute to jmstechhome8/web_login_automation development by creating an account on GitHub.

github.com

 

 

 

 

 

## 젠킨스 서버 접속 (EC2)

 

 

## deploy_node_webapp.yml

---
- hosts: server
  gather_facts: false
  become: yes
  become_user: ubuntu
  vars:
    ansible_python_interpreter: "/usr/bin/env python3"
  tasks:
    # Create Kubernetes replica set
    - name: Create replicaset object
      k8s:
        state: present
        definition:
          apiVersion: apps/v1
          kind: ReplicaSet
          metadata:
            name: webapp
            namespace: default
          spec:
            replicas: 2
            selector:
              matchLabels:
                app: node-webapp
            template:
              metadata:
                labels:
                  app: node-webapp
              spec:
                containers:
                - name: springapp
                  image: 403959134869.dkr.ecr.ap-south-1.amazonaws.com/nodeapp
                  ports:
                  - containerPort: 8080
                imagePullSecrets:
                - name: ap-south-1-ecr-registry

    - name: Create a Service to access spring app
      k8s:
        state: present
        definition:
          apiVersion: v1
          kind: Service
          metadata:
            name: hello-node-webapp
            namespace: default
          spec:
            type: NodePort
            ports:
            - port: 8080
              nodePort: 30003
              protocol: TCP
            selector:
              app: node-webapp

 

 

 

## 작업할 내용

 

 

 

 

 

## 젠킨스 설정

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

## 젠킨스 서버에서 AWS ECR 접속 연동

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

https://www.youtube.com/watch?v=nP6uei3TBsc 

 

반응형

댓글