This file contains 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
stages: | |
- build | |
- test | |
- deploy | |
variables: | |
# disable Docker TLS validation | |
DOCKER_TLS_CERTDIR: "" | |
# localhost address is shared by both the job container and the dind container (as they share the same Pod) | |
# So this configuration make the dind service as our Docker daemon when running Docker commands |
This file contains 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: testapp | |
namespace: argocd | |
spec: | |
project: default | |
source: | |
repoURL: git@gitlab.com:my/repo/charts.git | |
targetRevision: master |
This file contains 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
server: | |
config: | |
configManagementPlugins: | | |
- name: helmSecrets | |
init: | |
command: ["gpg"] | |
args: ["--import", "/home/argocd/gpg/gpg.asc"] # is mounted as a kube secret | |
generate: | |
command: ["/bin/sh", "-c"] | |
args: ["helm secrets template $HELM_OPTS $RELEASE_NAME ."] |
This file contains 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: testapp | |
namespace: argocd | |
spec: | |
project: default | |
source: | |
repoURL: git@gitlab.com:my/repo/charts.git | |
targetRevision: master |
This file contains 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
FROM argoproj/argocd:v1.8.7 | |
ARG SOPS_VERSION="v3.6.1" | |
ARG HELM_SECRETS_VERSION="2.0.2" | |
ARG HELM_GCS_VERSION="0.3.7" | |
ARG SOPS_PGP_FP="141B69EE206943BA9A64E691A00C9B1A7DCB6D07" | |
ENV SOPS_PGP_FP=${SOPS_PGP_FP} | |
USER root |
This file contains 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
const ng = cluster.addNodegroup("nodegroup", { | |
instanceType: new ec2.InstanceType("t3.medium"), | |
minSize: 1, | |
maxSize: 3, | |
}); |
This file contains 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
const vpc = new ec2.Vpc(this, "eks-vpc"); | |
const cluster = new eks.Cluster(this, "Cluster", { | |
vpc: vpc, | |
defaultCapacity: 0, // we want to manage capacity ourselves | |
version: eks.KubernetesVersion.V1_17, | |
}); |
This file contains 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: nginx-scale | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
This file contains 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
enableAutoscaling(cluster: eks.Cluster, ng: eks.Nodegroup, version: string = "v1.17.3") { | |
const autoscalerStmt = new iam.PolicyStatement(); | |
autoscalerStmt.addResources("*"); | |
autoscalerStmt.addActions( | |
"autoscaling:DescribeAutoScalingGroups", | |
"autoscaling:DescribeAutoScalingInstances", | |
"autoscaling:DescribeLaunchConfigurations", | |
"autoscaling:DescribeTags", | |
"autoscaling:SetDesiredCapacity", | |
"autoscaling:TerminateInstanceInAutoScalingGroup", |
This file contains 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
import * as cdk from "@aws-cdk/core"; | |
import * as eks from "@aws-cdk/aws-eks"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
import * as iam from "@aws-cdk/aws-iam"; | |
import { CfnJson } from "@aws-cdk/core"; | |
export class MyCluster extends cdk.Construct { | |
constructor(scope: cdk.Construct, id: string) { | |
super(scope, id); |