eksctl create cluster --name my-cluster --region us-east-1 --nodegroup-name my-nodegroup --node-type t3.medium --nodes 3 --nodes-min 1 --nodes-max 5
(eksctl create cluster --name my-cluster --region us-east-1 --nodegroup-name my-nodegroup --node-type t2.small --nodes 1 --nodes-min 1 --nodes-max 1)
eksctl scale nodegroup --cluster my-cluster --name my-nodegroup --nodes 1 --region us-east-1
(settings-> personal token -> allow all (required) permission)-> get personal token
flux bootstrap github --owner=hp40400 --repository=l1_support_semicolon_2023 --branch=main --path=./clusters/my-cluster --personal
in git repo, path -> clusters/my-cluster/defaultapp/deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
YOU WILL SEE NGINX PODS NOW..
==============
STEP2: With Kustomize
1. create folder call "accounts" under defaultapps.
inside accounts,
kustomization.yaml
"
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
namespace: default | |
resources: | |
- deploy.yaml |
"
deploy.yaml (same above deploy yml content without namespace line)
2. create below kustomization.yaml file under defaultapps.
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
namespace: default | |
resources: | |
- ./accounts YOU WILL SEE NGINX PODS .. |
https://fluxcd.io/flux/installation/
https://www.youtube.com/watch?v=8BRrBVpphNU
delete eks:
eksctl delete nodegroup --cluster my-cluster --name my-nodegroup --region us-west-2
eksctl delete cluster --name my-cluster --region us-west-2
====
image automation (not tested)
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
annotations:
fluxcd.io/automated: "true"
fluxcd.io/tag.app-image: semver:~1.0
spec:
containers:
- name: my-app
image: my-aws-account-id.dkr.ecr.my-region.amazonaws.com/my-app:1.0.0
imagePullPolicy: IfNotPresent
--
git permissions
No comments:
Post a Comment