- Added comprehensive course structure with 11 modules - Included theoretical content, practical examples, and tasks - Multi-language code examples (Java, Rust, Node.js, Python) - Detailed analysis of architectural approaches and trade-offs - Complete caching strategies documentation - Architecture examples from real-world systems (Twitter, Netflix, Uber) - Structured navigation and learning path - Ready for educational use
62 lines
1.3 KiB
Markdown
62 lines
1.3 KiB
Markdown
# CI/CD с контейнерами
|
|
|
|
## Навигация
|
|
- [🏠 Главная страница курса](../../../README.md)
|
|
- [📚 Модуль 3](../README.md)
|
|
|
|
---
|
|
|
|
## CI/CD Pipeline
|
|
|
|
```yaml
|
|
# .github/workflows/deploy.yml
|
|
name: Deploy to Kubernetes
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build Docker image
|
|
run: docker build -t ${{ secrets.REGISTRY }}/myapp:${{ github.sha }} .
|
|
|
|
- name: Push to registry
|
|
run: docker push ${{ secrets.REGISTRY }}/myapp:${{ github.sha }}
|
|
|
|
- name: Deploy to Kubernetes
|
|
run: |
|
|
kubectl set image deployment/myapp myapp=${{ secrets.REGISTRY }}/myapp:${{ github.sha }}
|
|
kubectl rollout status deployment/myapp
|
|
```
|
|
|
|
## GitOps
|
|
|
|
**GitOps** — подход к управлению инфраструктурой через Git.
|
|
|
|
### Пример ArgoCD:
|
|
```yaml
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Application
|
|
metadata:
|
|
name: myapp
|
|
namespace: argocd
|
|
spec:
|
|
project: default
|
|
source:
|
|
repoURL: https://github.com/myorg/myapp
|
|
targetRevision: HEAD
|
|
path: k8s
|
|
destination:
|
|
server: https://kubernetes.default.svc
|
|
namespace: default
|
|
syncPolicy:
|
|
automated:
|
|
prune: true
|
|
selfHeal: true
|
|
```
|