Skip to content

Commit

Permalink
Deploying Hello-World CR to kubernetes cluster with ArgoCD method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymedina committed Aug 16, 2024
1 parent 3e51006 commit c798ba8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
21 changes: 21 additions & 0 deletions deployments/stacks/dpe-k8s-deployments/deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: flask-helloworld
labels:
app: flask-helloworld
spec:
replicas: 1
selector:
matchLabels:
app: flask-helloworld
template:
metadata:
labels:
app: flask-helloworld
spec:
containers:
- name: flask
image: digitalocean/flask-helloworld:latest
ports:
- containerPort: 5000
36 changes: 36 additions & 0 deletions deployments/stacks/dpe-k8s-deployments/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,39 @@ module "argo-cd" {
source = "spacelift.io/sagebionetworks/argo-cd/aws"
version = "0.3.1"
}

locals {
my_branch_name = "ibcdpe-1005-test-run"
my_namespace_name = "my-cool-namespace"
my_application_name_in_argocd = "my-cool-application"
}

resource "kubernetes_namespace" "my-cool-namespace-resource" {
metadata {
name = local.my_namespace_name
}
}

resource "kubectl_manifest" "my-argocd-application" {
depends_on = [kubernetes_namespace.my-cool-namespace-resource]

yaml_body = <<YAML
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ${local.my_application_name_in_argocd}
namespace: argocd
spec:
project: default
syncPolicy:
automated:
prune: true
sources:
- repoURL: 'https://github.com/Sage-Bionetworks-Workflows/eks-stack.git'
targetRevision: ${local.my_branch_name}
path: deployments/stacks/dpe-k8s-deployments
destination:
server: 'https://kubernetes.default.svc'
namespace: ${local.my_namespace_name}
YAML
}

0 comments on commit c798ba8

Please sign in to comment.