From 5181036847193f0b730e1f5e2d61b3cf74343ab1 Mon Sep 17 00:00:00 2001 From: pramod03 Date: Wed, 8 Nov 2023 23:55:12 +0530 Subject: [PATCH 1/6] Delete unwanted dir --- argocd/apps/clusters/Chart.yaml | 24 - .../cluster-configs/aws-k8s-packages.yaml | 14 - .../templates/dev/dev-cluster-apps.yaml | 14 - .../clusters/templates/dev/dev-cluster.yaml | 14 - .../clusters/templates/prod/prod-apps.yaml | 0 .../clusters/templates/prod/prod-cluster.yaml | 0 argocd/apps/clusters/values.yaml | 0 argocd/apps/crossplane/.helmignore | 23 - argocd/apps/crossplane/Chart.yaml | 24 - .../aws-provider-configs/provider-config.yaml | 14 - argocd/apps/crossplane/values.yaml | 0 argocd/apps/tekton/Chart.yaml | 24 - .../tekton/templates/configs/configs.yaml | 0 .../tekton/templates/pipelines/pipelines.yaml | 14 - argocd/apps/tekton/values.yaml | 0 argocd/main-apps/clusters-main-app.yaml | 17 - argocd/main-apps/crossplane-main-app.yaml | 17 - argocd/main-apps/tekton-main-app.yaml | 17 - crossplane/README.md | 1 - crossplane/clusters/dev/dev-eks.yaml | 19 - crossplane/crossplane-config/provider.yaml | 28 -- .../crossplane-config/providerconfig.yaml | 9 - crossplane/packages/k8s/definition.yaml | 70 --- crossplane/packages/k8s/eks.yaml | 448 ------------------ crossplane/providers/chart.yaml | 0 observability/kyverno/chart.yaml | 0 .../tekton-pipelines/terraform/pipeline.yaml | 0 .../terraform/pipelinerun.yaml | 0 tekton/tekton-pipelines/terraform/task.yaml | 0 tekton/tekton-source/chart.yaml | 0 30 files changed, 791 deletions(-) delete mode 100644 argocd/apps/clusters/Chart.yaml delete mode 100644 argocd/apps/clusters/templates/cluster-configs/aws-k8s-packages.yaml delete mode 100644 argocd/apps/clusters/templates/dev/dev-cluster-apps.yaml delete mode 100644 argocd/apps/clusters/templates/dev/dev-cluster.yaml delete mode 100644 argocd/apps/clusters/templates/prod/prod-apps.yaml delete mode 100644 argocd/apps/clusters/templates/prod/prod-cluster.yaml delete mode 100644 argocd/apps/clusters/values.yaml delete mode 100644 argocd/apps/crossplane/.helmignore delete mode 100644 argocd/apps/crossplane/Chart.yaml delete mode 100644 argocd/apps/crossplane/templates/provider-configs/aws-provider-configs/provider-config.yaml delete mode 100644 argocd/apps/crossplane/values.yaml delete mode 100644 argocd/apps/tekton/Chart.yaml delete mode 100644 argocd/apps/tekton/templates/configs/configs.yaml delete mode 100644 argocd/apps/tekton/templates/pipelines/pipelines.yaml delete mode 100644 argocd/apps/tekton/values.yaml delete mode 100644 argocd/main-apps/clusters-main-app.yaml delete mode 100644 argocd/main-apps/crossplane-main-app.yaml delete mode 100644 argocd/main-apps/tekton-main-app.yaml delete mode 100644 crossplane/README.md delete mode 100644 crossplane/clusters/dev/dev-eks.yaml delete mode 100644 crossplane/crossplane-config/provider.yaml delete mode 100644 crossplane/crossplane-config/providerconfig.yaml delete mode 100644 crossplane/packages/k8s/definition.yaml delete mode 100644 crossplane/packages/k8s/eks.yaml delete mode 100644 crossplane/providers/chart.yaml delete mode 100644 observability/kyverno/chart.yaml delete mode 100644 tekton/tekton-pipelines/terraform/pipeline.yaml delete mode 100644 tekton/tekton-pipelines/terraform/pipelinerun.yaml delete mode 100644 tekton/tekton-pipelines/terraform/task.yaml delete mode 100644 tekton/tekton-source/chart.yaml diff --git a/argocd/apps/clusters/Chart.yaml b/argocd/apps/clusters/Chart.yaml deleted file mode 100644 index 5e5ef73..0000000 --- a/argocd/apps/clusters/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: cluster -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/argocd/apps/clusters/templates/cluster-configs/aws-k8s-packages.yaml b/argocd/apps/clusters/templates/cluster-configs/aws-k8s-packages.yaml deleted file mode 100644 index c391db1..0000000 --- a/argocd/apps/clusters/templates/cluster-configs/aws-k8s-packages.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: crossplane-aws-dev-cluster - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: infra/crossplane/packages/k8s - destination: - server: https://kubernetes.default.svc - namespace: crossplane diff --git a/argocd/apps/clusters/templates/dev/dev-cluster-apps.yaml b/argocd/apps/clusters/templates/dev/dev-cluster-apps.yaml deleted file mode 100644 index b4842a0..0000000 --- a/argocd/apps/clusters/templates/dev/dev-cluster-apps.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: dev-cluster-base-apps - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: apps - destination: - server: https://kubernetes.default.svc - namespace: crossplane diff --git a/argocd/apps/clusters/templates/dev/dev-cluster.yaml b/argocd/apps/clusters/templates/dev/dev-cluster.yaml deleted file mode 100644 index 6b6ff14..0000000 --- a/argocd/apps/clusters/templates/dev/dev-cluster.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: crossplane-aws-dev-cluster - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: infra/crossplane/clusters/dev - destination: - server: https://kubernetes.default.svc - namespace: crossplane diff --git a/argocd/apps/clusters/templates/prod/prod-apps.yaml b/argocd/apps/clusters/templates/prod/prod-apps.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/apps/clusters/templates/prod/prod-cluster.yaml b/argocd/apps/clusters/templates/prod/prod-cluster.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/apps/clusters/values.yaml b/argocd/apps/clusters/values.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/apps/crossplane/.helmignore b/argocd/apps/crossplane/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/argocd/apps/crossplane/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/argocd/apps/crossplane/Chart.yaml b/argocd/apps/crossplane/Chart.yaml deleted file mode 100644 index a7fe41f..0000000 --- a/argocd/apps/crossplane/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: crossplane-apps -description: A Helm chart for creating crossplane apps - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/argocd/apps/crossplane/templates/provider-configs/aws-provider-configs/provider-config.yaml b/argocd/apps/crossplane/templates/provider-configs/aws-provider-configs/provider-config.yaml deleted file mode 100644 index 6ee2f50..0000000 --- a/argocd/apps/crossplane/templates/provider-configs/aws-provider-configs/provider-config.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: crossplane-aws-dev-cluster - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: infra/crossplane/crossplane-config - destination: - server: https://kubernetes.default.svc - namespace: crossplane diff --git a/argocd/apps/crossplane/values.yaml b/argocd/apps/crossplane/values.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/apps/tekton/Chart.yaml b/argocd/apps/tekton/Chart.yaml deleted file mode 100644 index 69270c8..0000000 --- a/argocd/apps/tekton/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: tekton-apps -description: A Helm chart for tekton apps - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/argocd/apps/tekton/templates/configs/configs.yaml b/argocd/apps/tekton/templates/configs/configs.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/apps/tekton/templates/pipelines/pipelines.yaml b/argocd/apps/tekton/templates/pipelines/pipelines.yaml deleted file mode 100644 index 61b5a6d..0000000 --- a/argocd/apps/tekton/templates/pipelines/pipelines.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: tekton-pipeline-dev-cluster - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: tekton/tekton-pipelines/tekton-yamls - destination: - server: https://kubernetes.default.svc - namespace: tek diff --git a/argocd/apps/tekton/values.yaml b/argocd/apps/tekton/values.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/argocd/main-apps/clusters-main-app.yaml b/argocd/main-apps/clusters-main-app.yaml deleted file mode 100644 index 64aba19..0000000 --- a/argocd/main-apps/clusters-main-app.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: clusters - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: HEAD - path: argocd/apps/clusters - helm: - valueFiles: - - values.yaml - destination: - server: https://kubernetes.default.svc - namespace: tekton-pipelines diff --git a/argocd/main-apps/crossplane-main-app.yaml b/argocd/main-apps/crossplane-main-app.yaml deleted file mode 100644 index cdd2629..0000000 --- a/argocd/main-apps/crossplane-main-app.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: crossplane-apps - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: main - path: argocd/apps/crossplane - helm: - valueFiles: - - values.yaml - destination: - server: https://kubernetes.default.svc - namespace: crossplane diff --git a/argocd/main-apps/tekton-main-app.yaml b/argocd/main-apps/tekton-main-app.yaml deleted file mode 100644 index f977fc4..0000000 --- a/argocd/main-apps/tekton-main-app.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: tekton-apps - namespace: argo-cd -spec: - project: default - source: - repoURL: https://github.com/intelops/capten-templates.git - targetRevision: HEAD - path: argocd/apps/tekton - helm: - valueFiles: - - values.yaml - destination: - server: https://kubernetes.default.svc - namespace: tekton-pipelines diff --git a/crossplane/README.md b/crossplane/README.md deleted file mode 100644 index 8d1c48e..0000000 --- a/crossplane/README.md +++ /dev/null @@ -1 +0,0 @@ -# crossplane \ No newline at end of file diff --git a/crossplane/clusters/dev/dev-eks.yaml b/crossplane/clusters/dev/dev-eks.yaml deleted file mode 100644 index 2238b69..0000000 --- a/crossplane/clusters/dev/dev-eks.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: prodready.cluster/v1alpha1 -kind: ClusterClaim -metadata: - labels: - cluster-owner: cem - name: dev-eks -spec: - compositeDeletePolicy: Background - compositionRef: - name: cluster-aws - compositionSelector: - matchLabels: - cluster: eks - provider: aws - compositionUpdatePolicy: Automatic - id: dev-eks - parameters: - minNodeCount: 3 - nodeSize: small diff --git a/crossplane/crossplane-config/provider.yaml b/crossplane/crossplane-config/provider.yaml deleted file mode 100644 index 3efc62f..0000000 --- a/crossplane/crossplane-config/provider.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: ControllerConfig -metadata: - name: aws-vault-config -spec: - args: - - --debug - metadata: - annotations: - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/role: "crossplane-providers" - vault.hashicorp.com/agent-inject-secret-creds.txt: "secret/provider-creds/aws-default" - vault.hashicorp.com/agent-inject-template-creds.txt: | - {{- with secret "secret/provider-creds/aws-default" -}} - [default] - aws_access_key_id="{{ .Data.data.access_key }}" - aws_secret_access_key="{{ .Data.data.secret_key }}" - {{- end -}} ---- -apiVersion: pkg.crossplane.io/v1 -kind: Provider -metadata: - name: provider-aws -spec: - package: xpkg.upbound.io/crossplane-contrib/provider-aws:v0.33.0 - controllerConfigRef: - name: aws-vault-config - diff --git a/crossplane/crossplane-config/providerconfig.yaml b/crossplane/crossplane-config/providerconfig.yaml deleted file mode 100644 index 0a6922e..0000000 --- a/crossplane/crossplane-config/providerconfig.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: aws.crossplane.io/v1beta1 -kind: ProviderConfig -metadata: - name: default -spec: - credentials: - source: Filesystem - fs: - path: /vault/secrets/creds.txt diff --git a/crossplane/packages/k8s/definition.yaml b/crossplane/packages/k8s/definition.yaml deleted file mode 100644 index 47c8a88..0000000 --- a/crossplane/packages/k8s/definition.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: CompositeResourceDefinition -metadata: - name: compositeclusters.prodready.cluster -spec: - connectionSecretKeys: - - kubeconfig - defaultCompositionRef: - name: cluster-aws - group: prodready.cluster - names: - kind: CompositeCluster - plural: compositeclusters - claimNames: - kind: ClusterClaim - plural: clusterclaims - versions: - - name: v1alpha1 - served: true - referenceable: true - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - id: - type: string - description: ID of this Cluster that other objects will use to refer to it. - parameters: - type: object - properties: - version: - description: The Kubernetes version for the cluster. - type: string - nodeSize: - description: The size of the nodes; small, medium, large - type: string - minNodeCount: - description: The minimum number of nodes - type: integer - default: 1 - required: - - nodeSize - required: - - id - - parameters - status: - type: object - properties: - clusterName: - description: The name of the cluster - type: string - controlPlaneStatus: - description: The status of the control plane - type: string - nodePoolStatus: - description: The status of the node pool - type: string - additionalPrinterColumns: - - name: clusterName - type: string - jsonPath: ".status.clusterName" - - name: controlPlane - type: string - jsonPath: ".status.controlPlaneStatus" - - name: nodePool - type: string - jsonPath: ".status.nodePoolStatus" diff --git a/crossplane/packages/k8s/eks.yaml b/crossplane/packages/k8s/eks.yaml deleted file mode 100644 index 22b8f10..0000000 --- a/crossplane/packages/k8s/eks.yaml +++ /dev/null @@ -1,448 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: Composition -metadata: - name: cluster-aws - labels: - provider: aws - cluster: eks -spec: - compositeTypeRef: - apiVersion: prodready.cluster/v1alpha1 - kind: CompositeCluster - writeConnectionSecretsToNamespace: crossplane - patchSets: - - name: metadata - patches: - - fromFieldPath: metadata.labels - resources: - - name: ekscluster - base: - apiVersion: eks.aws.crossplane.io/v1beta1 - kind: Cluster - spec: - forProvider: - region: us-east-1 - version: "1.27" - roleArnSelector: - matchControllerRef: true - resourcesVpcConfig: - endpointPrivateAccess: true - endpointPublicAccess: true - subnetIdSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - - fromFieldPath: spec.parameters.version - toFieldPath: spec.forProvider.version - - fromFieldPath: spec.id - toFieldPath: spec.writeConnectionSecretToRef.name - transforms: - - type: string - string: - fmt: "%s-cluster" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleArnSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-controlplane" - - type: ToCompositeFieldPath - fromFieldPath: metadata.name - toFieldPath: status.clusterName - - type: ToCompositeFieldPath - fromFieldPath: status.atProvider.status - toFieldPath: status.controlPlaneStatus - - fromFieldPath: spec.writeConnectionSecretToRef.namespace - toFieldPath: spec.writeConnectionSecretToRef.namespace - readinessChecks: - - type: MatchString - fieldPath: status.atProvider.status - matchString: ACTIVE - connectionDetails: - - fromConnectionSecretKey: kubeconfig - - name: eksnodegroup - base: - apiVersion: eks.aws.crossplane.io/v1alpha1 - kind: NodeGroup - spec: - forProvider: - region: us-east-1 - clusterNameSelector: - matchControllerRef: true - nodeRoleSelector: - matchControllerRef: true - subnetSelector: - matchLabels: - access: public - scalingConfig: - minSize: 1 - maxSize: 10 - desiredSize: 1 - instanceTypes: - - t3.small - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - - fromFieldPath: spec.parameters.nodeSize - toFieldPath: spec.forProvider.instanceTypes[0] - transforms: - - type: map - map: - small: t3.small - medium: t3.medium - large: t3.large - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.nodeRoleSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - fromFieldPath: spec.parameters.minNodeCount - toFieldPath: spec.forProvider.scalingConfig.minSize - - fromFieldPath: spec.parameters.minNodeCount - toFieldPath: spec.forProvider.scalingConfig.desiredSize - - type: ToCompositeFieldPath - fromFieldPath: status.atProvider.status - toFieldPath: status.nodePoolStatus - readinessChecks: - - type: MatchString - fieldPath: status.atProvider.status - matchString: ACTIVE - - name: iamrole-controlplane - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: Role - spec: - forProvider: - assumeRolePolicyDocument: | - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": [ - "eks.amazonaws.com" - ] - }, - "Action": [ - "sts:AssumeRole" - ] - } - ] - } - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-controlplane" - - fromFieldPath: spec.id - toFieldPath: metadata.labels.role - transforms: - - type: string - string: - fmt: "%s-controlplane" - - name: iamrole-nodegroup - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: Role - spec: - forProvider: - assumeRolePolicyDocument: | - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": [ - "ec2.amazonaws.com" - ] - }, - "Action": [ - "sts:AssumeRole" - ] - } - ] - } - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - fromFieldPath: spec.id - toFieldPath: metadata.labels.role - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - name: iamattachment-controlplane - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: RolePolicyAttachment - spec: - forProvider: - policyArn: arn:aws:iam::aws:policy/AmazonEKSClusterPolicy - roleNameSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-controlplane" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleNameSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-controlplane" - - name: iamattachment-service - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: RolePolicyAttachment - spec: - forProvider: - policyArn: arn:aws:iam::aws:policy/AmazonEKSServicePolicy - roleNameSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-service" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleNameSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-controlplane" - - name: iamattachment-worker - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: RolePolicyAttachment - spec: - forProvider: - policyArn: arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy - roleNameSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-worker" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleNameSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - name: iamattachment-cni - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: RolePolicyAttachment - spec: - forProvider: - policyArn: arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy - roleNameSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-cni" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleNameSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - name: iamattachment-registry - base: - apiVersion: iam.aws.crossplane.io/v1beta1 - kind: RolePolicyAttachment - spec: - forProvider: - policyArn: arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly - roleNameSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-registry" - - fromFieldPath: spec.id - toFieldPath: spec.forProvider.roleNameSelector.matchLabels.role - transforms: - - type: string - string: - fmt: "%s-nodegroup" - - name: vpc-nodepool - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: VPC - spec: - forProvider: - region: us-east-1 - cidrBlock: 10.0.0.0/16 - enableDnsSupport: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - - name: sg-nodepool - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: SecurityGroup - spec: - forProvider: - description: Cluster communication with worker nodes - groupName: devops-catalog - region: us-east-1 - vpcIdSelector: - matchControllerRef: true - egress: - - fromPort: 0 - toPort: 0 - ipProtocol: "-1" - ipRanges: - - cidrIp: "0.0.0.0/0" - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - - name: subnet-nodepool-1a - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: Subnet - metadata: - labels: - zone: us-east-1a - access: public - spec: - forProvider: - region: us-east-1 - availabilityZone: us-east-1a - cidrBlock: 10.0.0.0/24 - vpcIdSelector: - matchControllerRef: true - mapPublicIPOnLaunch: true - tags: - - key: kubernetes.io/role/elb - value: "1" - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-1a" - - name: subnet-nodepool-1b - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: Subnet - metadata: - labels: - zone: us-east-1b - access: public - spec: - forProvider: - region: us-east-1 - availabilityZone: us-east-1b - cidrBlock: 10.0.1.0/24 - vpcIdSelector: - matchControllerRef: true - mapPublicIPOnLaunch: true - tags: - - key: kubernetes.io/role/elb - value: "1" - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-1b" - - name: subnet-nodepool-1c - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: Subnet - metadata: - labels: - zone: us-east-1c - access: public - spec: - forProvider: - region: us-east-1 - availabilityZone: us-east-1c - cidrBlock: 10.0.2.0/24 - vpcIdSelector: - matchControllerRef: true - mapPublicIPOnLaunch: true - tags: - - key: kubernetes.io/role/elb - value: "1" - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - transforms: - - type: string - string: - fmt: "%s-1c" - - name: gateway - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: InternetGateway - spec: - forProvider: - region: us-east-1 - vpcIdSelector: - matchControllerRef: true - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - - name: routetable - base: - apiVersion: ec2.aws.crossplane.io/v1beta1 - kind: RouteTable - spec: - forProvider: - region: us-east-1 - vpcIdSelector: - matchControllerRef: true - routes: - - destinationCidrBlock: 0.0.0.0/0 - gatewayIdSelector: - matchControllerRef: true - associations: - - subnetIdSelector: - matchControllerRef: true - matchLabels: - zone: us-east-1a - access: public - - subnetIdSelector: - matchControllerRef: true - matchLabels: - zone: us-east-1b - access: public - - subnetIdSelector: - matchControllerRef: true - matchLabels: - zone: us-east-1c - access: public - patches: - - fromFieldPath: spec.id - toFieldPath: metadata.name - diff --git a/crossplane/providers/chart.yaml b/crossplane/providers/chart.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/observability/kyverno/chart.yaml b/observability/kyverno/chart.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tekton/tekton-pipelines/terraform/pipeline.yaml b/tekton/tekton-pipelines/terraform/pipeline.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tekton/tekton-pipelines/terraform/pipelinerun.yaml b/tekton/tekton-pipelines/terraform/pipelinerun.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tekton/tekton-pipelines/terraform/task.yaml b/tekton/tekton-pipelines/terraform/task.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tekton/tekton-source/chart.yaml b/tekton/tekton-source/chart.yaml deleted file mode 100644 index e69de29..0000000 From f86d2d643321f8fc71f536b49ca53ec29dd362b3 Mon Sep 17 00:00:00 2001 From: pramod03 Date: Thu, 9 Nov 2023 00:11:15 +0530 Subject: [PATCH 2/6] Restructure and implement comments --- .../aws-composition.yaml} | 2 +- .../compositions/aws}/eks.yaml | 0 .../aws-packages/aws-k8s-package.yaml} | 4 +-- .../crossplane-config/provider.yaml | 28 ------------------- .../crossplane-config/providerconfig.yaml | 9 ------ .../k8s/aws}/definition.yaml | 0 infra/crossplane/providers/chart.yaml | 0 7 files changed, 3 insertions(+), 40 deletions(-) rename infra/clusters/argocd-apps/templates/{cluster-configs/aws-k8s-packages.yaml => cluster-compositions/aws-composition.yaml} (88%) rename infra/{crossplane/packages/k8s => clusters/compositions/aws}/eks.yaml (100%) rename infra/crossplane/argocd-apps/templates/{provider-configs/aws-provider-configs/provider-config.yaml => package-k8s/aws-packages/aws-k8s-package.yaml} (78%) delete mode 100644 infra/crossplane/crossplane-config/provider.yaml delete mode 100644 infra/crossplane/crossplane-config/providerconfig.yaml rename infra/crossplane/{packages/k8s => packages-def/k8s/aws}/definition.yaml (100%) delete mode 100644 infra/crossplane/providers/chart.yaml diff --git a/infra/clusters/argocd-apps/templates/cluster-configs/aws-k8s-packages.yaml b/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml similarity index 88% rename from infra/clusters/argocd-apps/templates/cluster-configs/aws-k8s-packages.yaml rename to infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml index c391db1..3bcf74f 100644 --- a/infra/clusters/argocd-apps/templates/cluster-configs/aws-k8s-packages.yaml +++ b/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml @@ -8,7 +8,7 @@ spec: source: repoURL: https://github.com/intelops/capten-templates.git targetRevision: main - path: infra/crossplane/packages/k8s + path: infra/clusters/compositions/aws destination: server: https://kubernetes.default.svc namespace: crossplane diff --git a/infra/crossplane/packages/k8s/eks.yaml b/infra/clusters/compositions/aws/eks.yaml similarity index 100% rename from infra/crossplane/packages/k8s/eks.yaml rename to infra/clusters/compositions/aws/eks.yaml diff --git a/infra/crossplane/argocd-apps/templates/provider-configs/aws-provider-configs/provider-config.yaml b/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml similarity index 78% rename from infra/crossplane/argocd-apps/templates/provider-configs/aws-provider-configs/provider-config.yaml rename to infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml index 6ee2f50..6672905 100644 --- a/infra/crossplane/argocd-apps/templates/provider-configs/aws-provider-configs/provider-config.yaml +++ b/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml @@ -1,14 +1,14 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: crossplane-aws-dev-cluster + name: aws-k8s-package namespace: argo-cd spec: project: default source: repoURL: https://github.com/intelops/capten-templates.git targetRevision: main - path: infra/crossplane/crossplane-config + path: infra/crossplane/packages/k8s/aws destination: server: https://kubernetes.default.svc namespace: crossplane diff --git a/infra/crossplane/crossplane-config/provider.yaml b/infra/crossplane/crossplane-config/provider.yaml deleted file mode 100644 index 3efc62f..0000000 --- a/infra/crossplane/crossplane-config/provider.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: ControllerConfig -metadata: - name: aws-vault-config -spec: - args: - - --debug - metadata: - annotations: - vault.hashicorp.com/agent-inject: "true" - vault.hashicorp.com/role: "crossplane-providers" - vault.hashicorp.com/agent-inject-secret-creds.txt: "secret/provider-creds/aws-default" - vault.hashicorp.com/agent-inject-template-creds.txt: | - {{- with secret "secret/provider-creds/aws-default" -}} - [default] - aws_access_key_id="{{ .Data.data.access_key }}" - aws_secret_access_key="{{ .Data.data.secret_key }}" - {{- end -}} ---- -apiVersion: pkg.crossplane.io/v1 -kind: Provider -metadata: - name: provider-aws -spec: - package: xpkg.upbound.io/crossplane-contrib/provider-aws:v0.33.0 - controllerConfigRef: - name: aws-vault-config - diff --git a/infra/crossplane/crossplane-config/providerconfig.yaml b/infra/crossplane/crossplane-config/providerconfig.yaml deleted file mode 100644 index 0a6922e..0000000 --- a/infra/crossplane/crossplane-config/providerconfig.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: aws.crossplane.io/v1beta1 -kind: ProviderConfig -metadata: - name: default -spec: - credentials: - source: Filesystem - fs: - path: /vault/secrets/creds.txt diff --git a/infra/crossplane/packages/k8s/definition.yaml b/infra/crossplane/packages-def/k8s/aws/definition.yaml similarity index 100% rename from infra/crossplane/packages/k8s/definition.yaml rename to infra/crossplane/packages-def/k8s/aws/definition.yaml diff --git a/infra/crossplane/providers/chart.yaml b/infra/crossplane/providers/chart.yaml deleted file mode 100644 index e69de29..0000000 From 290f63defab0206b57b511fa0ad83fb818eed2f4 Mon Sep 17 00:00:00 2001 From: pramod03 Date: Sat, 11 Nov 2023 23:36:32 +0530 Subject: [PATCH 3/6] revert changes --- .../argocd-apps/templates/providers/provider.yaml | 14 ++++++++++++++ .../crossplane/providers/aws/provider-config.yaml | 0 infra/crossplane/providers/aws/provider.yaml | 0 3 files changed, 14 insertions(+) create mode 100644 infra/crossplane/argocd-apps/templates/providers/provider.yaml create mode 100644 infra/crossplane/providers/aws/provider-config.yaml create mode 100644 infra/crossplane/providers/aws/provider.yaml diff --git a/infra/crossplane/argocd-apps/templates/providers/provider.yaml b/infra/crossplane/argocd-apps/templates/providers/provider.yaml new file mode 100644 index 0000000..d9eef38 --- /dev/null +++ b/infra/crossplane/argocd-apps/templates/providers/provider.yaml @@ -0,0 +1,14 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: providers + namespace: argo-cd +spec: + project: default + source: + repoURL: https://github.com/intelops/capten-templates.git + targetRevision: main + path: infra/crossplane/providers + destination: + server: https://kubernetes.default.svc + namespace: crossplane \ No newline at end of file diff --git a/infra/crossplane/providers/aws/provider-config.yaml b/infra/crossplane/providers/aws/provider-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/infra/crossplane/providers/aws/provider.yaml b/infra/crossplane/providers/aws/provider.yaml new file mode 100644 index 0000000..e69de29 From 45dacce37a02ae2b278b7768d233679ffd23238c Mon Sep 17 00:00:00 2001 From: vpramod03 <110480433+vpramod03@users.noreply.github.com> Date: Sun, 12 Nov 2023 00:08:19 +0530 Subject: [PATCH 4/6] add provider values --- infra/crossplane/crossplane-config/providers-placeholsers.yaml | 0 infra/crossplane/packages-def/k8s/aws/providerconfig.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 infra/crossplane/crossplane-config/providers-placeholsers.yaml create mode 100644 infra/crossplane/packages-def/k8s/aws/providerconfig.yaml diff --git a/infra/crossplane/crossplane-config/providers-placeholsers.yaml b/infra/crossplane/crossplane-config/providers-placeholsers.yaml new file mode 100644 index 0000000..e69de29 diff --git a/infra/crossplane/packages-def/k8s/aws/providerconfig.yaml b/infra/crossplane/packages-def/k8s/aws/providerconfig.yaml new file mode 100644 index 0000000..e69de29 From 2ec19ab0c6c831ce0aa38dab72284808697f8fb1 Mon Sep 17 00:00:00 2001 From: vpramod03 <110480433+vpramod03@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:23:35 +0530 Subject: [PATCH 5/6] Fix as per comments --- infra/clusters/argocd-apps/templates/dev/dev-cluster.yaml | 5 ++++- .../templates/package-k8s/aws-packages/aws-k8s-package.yaml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/infra/clusters/argocd-apps/templates/dev/dev-cluster.yaml b/infra/clusters/argocd-apps/templates/dev/dev-cluster.yaml index 6b6ff14..21cdaa9 100644 --- a/infra/clusters/argocd-apps/templates/dev/dev-cluster.yaml +++ b/infra/clusters/argocd-apps/templates/dev/dev-cluster.yaml @@ -8,7 +8,10 @@ spec: source: repoURL: https://github.com/intelops/capten-templates.git targetRevision: main - path: infra/crossplane/clusters/dev + path: infra/crossplane/clusters/dev/clusterconfigs destination: server: https://kubernetes.default.svc namespace: crossplane + syncPolicy: + automated: + prune: true diff --git a/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml b/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml index 6672905..44cece6 100644 --- a/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml +++ b/infra/crossplane/argocd-apps/templates/package-k8s/aws-packages/aws-k8s-package.yaml @@ -8,7 +8,7 @@ spec: source: repoURL: https://github.com/intelops/capten-templates.git targetRevision: main - path: infra/crossplane/packages/k8s/aws + path: infra/crossplane/packages-def/k8s/aws destination: server: https://kubernetes.default.svc namespace: crossplane From 370493631c2da6d020cac71525382eacaa695b09 Mon Sep 17 00:00:00 2001 From: vpramod03 <110480433+vpramod03@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:53:23 +0530 Subject: [PATCH 6/6] Fix comments --- .../templates/cluster-compositions/aws-composition.yaml | 3 +++ infra/clusters/argocd-apps/templates/dev/dev-cluster-apps.yaml | 3 +++ infra/clusters/dev/{ => clusterconfig}/dev-eks.yaml | 0 infra/clusters/{ => prod/clusterconfig}/clusters-main-app.yaml | 3 +++ 4 files changed, 9 insertions(+) rename infra/clusters/dev/{ => clusterconfig}/dev-eks.yaml (100%) rename infra/clusters/{ => prod/clusterconfig}/clusters-main-app.yaml (89%) diff --git a/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml b/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml index ac3332f..fe6fca0 100644 --- a/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml +++ b/infra/clusters/argocd-apps/templates/cluster-compositions/aws-composition.yaml @@ -12,3 +12,6 @@ spec: destination: server: https://kubernetes.default.svc namespace: crossplane + syncPolicy: + automated: + prune: true diff --git a/infra/clusters/argocd-apps/templates/dev/dev-cluster-apps.yaml b/infra/clusters/argocd-apps/templates/dev/dev-cluster-apps.yaml index b4842a0..8cdf101 100644 --- a/infra/clusters/argocd-apps/templates/dev/dev-cluster-apps.yaml +++ b/infra/clusters/argocd-apps/templates/dev/dev-cluster-apps.yaml @@ -12,3 +12,6 @@ spec: destination: server: https://kubernetes.default.svc namespace: crossplane + syncPolicy: + automated: + prune: true \ No newline at end of file diff --git a/infra/clusters/dev/dev-eks.yaml b/infra/clusters/dev/clusterconfig/dev-eks.yaml similarity index 100% rename from infra/clusters/dev/dev-eks.yaml rename to infra/clusters/dev/clusterconfig/dev-eks.yaml diff --git a/infra/clusters/clusters-main-app.yaml b/infra/clusters/prod/clusterconfig/clusters-main-app.yaml similarity index 89% rename from infra/clusters/clusters-main-app.yaml rename to infra/clusters/prod/clusterconfig/clusters-main-app.yaml index 4bbdba1..93397c1 100644 --- a/infra/clusters/clusters-main-app.yaml +++ b/infra/clusters/prod/clusterconfig/clusters-main-app.yaml @@ -15,3 +15,6 @@ spec: destination: server: https://kubernetes.default.svc namespace: tekton-pipelines + syncPolicy: + automated: + prune: true \ No newline at end of file