Skip to content

Instantly share code, notes, and snippets.

@Vikash-8090-Yadav
Last active May 26, 2023 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vikash-8090-Yadav/b901b4ab3248fc02212ef0762e544dc5 to your computer and use it in GitHub Desktop.
Save Vikash-8090-Yadav/b901b4ab3248fc02212ef0762e544dc5 to your computer and use it in GitHub Desktop.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: k8sargocd
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/Vikash-8090-Yadav/K8S-Argocd_Project
targetRevision: HEAD
path: argo
destination:
server: https://kubernetes.default.svc
namespace: myapp
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
prune: true
apiVersion: apps/v1
kind: Deployment
metadata:
name: first-deployment
labels:
app: first
spec:
replicas: 3
selector:
matchLabels:
app: first
template:
metadata:
labels:
app: first
spec:
containers:
- name: first
image: docker.io/vikash98yadav/githubtwin:latest
imagePullPolicy: "Always"
ports:
- containerPort: 8000
apiVersion: v1
kind: Service
metadata:
name: first-service
spec:
type: NodePort
selector:
app: first
ports:
# By default and for convenience, the `targetPort` is set to the same value as the `port` field.
- port: 80
targetPort: 8000
# Optional field
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767)
nodePort: 30007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment