This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx | |
labels: | |
app: nginx | |
spec: | |
securityContext: | |
seccompProfile: | |
type: Localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Kubernetes Cluster and Install Argo | |
on: push | |
jobs: | |
deploy-terraform: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./terraform | |
steps: | |
- uses: actions/checkout@v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "kubectl_file_documents" "my-nginx-app" { | |
content = file("../manifests/argocd/my-nginx-app.yaml") | |
} | |
resource "kubectl_manifest" "my-nginx-app" { | |
depends_on = [ | |
kubectl_manifest.argocd, | |
] | |
count = length(data.kubectl_file_documents.my-nginx-app.documents) | |
yaml_body = element(data.kubectl_file_documents.my-nginx-app.documents, count.index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Application | |
metadata: | |
name: my-nginx | |
namespace: argocd | |
finalizers: | |
- resources-finalizer.argocd.argoproj.io | |
spec: | |
project: default | |
source: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-nginx | |
spec: | |
selector: | |
matchLabels: | |
run: my-nginx | |
replicas: 2 | |
template: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "kubectl" { | |
host = module.gke_auth.host | |
cluster_ca_certificate = module.gke_auth.cluster_ca_certificate | |
token = module.gke_auth.token | |
load_config_file = false | |
} | |
data "kubectl_file_documents" "namespace" { | |
content = file("../manifests/argocd/namespace.yaml") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: argocd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "google" { | |
project = var.project_id | |
region = var.region | |
zone = var.location | |
} | |
resource "google_service_account" "main" { | |
account_id = "${var.cluster_name}-sa" | |
display_name = "GKE Cluster ${var.cluster_name} Service Account" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_version = ">= 0.13" | |
required_providers { | |
kubectl = { | |
source = "gavinbunney/kubectl" | |
version = ">= 1.7.0" | |
} | |
} | |
backend "gcs" { | |
bucket = "terraform-backend-<project-id>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF | kubectl apply -f - | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: nginx | |
replicas: 2 |
NewerOlder