From 6150e82d927fd887f87b5d640514d0425e769027 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 14 Aug 2019 14:44:15 -0700 Subject: [PATCH] Clean-up (#35) --- README.md | 19 ++++---- applications-helm/Chart.yaml | 10 ---- applications-helm/templates/_helpers.tpl | 32 ------------- applications-helm/templates/applications.yaml | 30 ------------ applications-helm/templates/argocd-cm.yaml | 25 ---------- .../templates/argocd-rbac-cm.yaml | 19 -------- applications-helm/templates/project.yaml | 45 ------------------ applications-helm/values-global.yaml | 46 ------------------- applications-helm/values-production.yaml | 19 -------- applications-helm/values-staging.yaml | 19 -------- {applications => apps}/Chart.yaml | 0 .../templates/guestbook.yaml | 0 .../templates/helm-dependency.yaml | 0 .../templates/helm-guestbook.yaml | 0 .../templates/kustomize-guestbook.yaml | 0 {applications => apps}/values.yaml | 0 16 files changed, 9 insertions(+), 255 deletions(-) delete mode 100644 applications-helm/Chart.yaml delete mode 100644 applications-helm/templates/_helpers.tpl delete mode 100644 applications-helm/templates/applications.yaml delete mode 100644 applications-helm/templates/argocd-cm.yaml delete mode 100644 applications-helm/templates/argocd-rbac-cm.yaml delete mode 100644 applications-helm/templates/project.yaml delete mode 100644 applications-helm/values-global.yaml delete mode 100644 applications-helm/values-production.yaml delete mode 100644 applications-helm/values-staging.yaml rename {applications => apps}/Chart.yaml (100%) rename {applications => apps}/templates/guestbook.yaml (100%) rename {applications => apps}/templates/helm-dependency.yaml (100%) rename {applications => apps}/templates/helm-guestbook.yaml (100%) rename {applications => apps}/templates/kustomize-guestbook.yaml (100%) rename {applications => apps}/values.yaml (100%) diff --git a/README.md b/README.md index ce50b1f..9b0ec34 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,16 @@ to explore ArgoCD and GitOps! | Application | Description | |-------------|-------------| -| [guestbook](guestbook/) | A hello word guestbook application as plain YAML | -| [ksonnet-guestbook](ksonnet-guestbook/) | The guestbook application as a ksonnet app | -| [helm-guestbook](helm-guestbook/) | The guestbook application as a Helm chart | -| [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook application as a raw jsonnet | -| [jsonnet-guestbook-tla](jsonnet-guestbook-tla/) | The guestbook application as a raw jsonnet with support for top level arguments | -| [kustomize-guestbook](kustomize-guestbook/) | The guestbook application as a Kustomize 2 app | +| [guestbook](guestbook/) | A hello word guestbook app as plain YAML | +| [ksonnet-guestbook](ksonnet-guestbook/) | The guestbook app as a ksonnet app | +| [helm-guestbook](helm-guestbook/) | The guestbook app as a Helm chart | +| [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook app as a raw jsonnet | +| [jsonnet-guestbook-tla](jsonnet-guestbook-tla/) | The guestbook app as a raw jsonnet with support for top level arguments | +| [kustomize-guestbook](kustomize-guestbook/) | The guestbook app as a Kustomize 2 app | | [pre-post-sync](pre-post-sync/) | Demonstrates Argo CD PreSync and PostSync hooks | | [sync-waves](sync-waves/) | Demonstrates Argo CD sync waves with hooks | | [helm-dependency](helm-dependency/) | Demonstrates how to customize an OTS (off-the-shelf) helm chart from an upstream repo | -| [sock-shop](sock-shop/) | A microservices demo application (https://microservices-demo.github.io) | -| [plugins](plugins/) | Applications which demonstrate config management plugins usage | +| [sock-shop](sock-shop/) | A microservices demo app (https://microservices-demo.github.io) | +| [plugins](plugins/) | Apps which demonstrate config management plugins usage | | [blue-green](blue-green/) | Demonstrates how to implement blue-green deployment using [Argo Rollouts](https://github.com/argoproj/argo-rollouts) -| [applications](applications/) | An application composed of other applications | -| [applications-helm](applications-helm/) | Demonstrates application composed of other applications using Helm chart and value files | +| [apps](apps/) | An app composed of other apps | diff --git a/applications-helm/Chart.yaml b/applications-helm/Chart.yaml deleted file mode 100644 index be61655..0000000 --- a/applications-helm/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -version: 1 -appVersion: "0.12" -description: application of applications example -name: application-of-applications -keywords: - - argocd -maintainers: - - name: Omer Kahani - email: omer@riskified.com diff --git a/applications-helm/templates/_helpers.tpl b/applications-helm/templates/_helpers.tpl deleted file mode 100644 index bd65c45..0000000 --- a/applications-helm/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "argo-cd.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "argo-cd.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "argo-cd.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/applications-helm/templates/applications.yaml b/applications-helm/templates/applications.yaml deleted file mode 100644 index 23113e3..0000000 --- a/applications-helm/templates/applications.yaml +++ /dev/null @@ -1,30 +0,0 @@ -{{- $namespace := .Values.argo_namespace -}} -{{- $chart_name := include "argo-cd.name" . -}} -{{- $chart := include "argo-cd.chart" . -}} - -{{- range .Values.applications }} -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: {{ .name }} - namespace: {{ $namespace }} -labels: - app.kubernetes.io/name: {{ $chart_name }} - helm.sh/chart: {{ $chart }} - app.kubernetes.io/instance: {{ $.Release.Name }} - app.kubernetes.io/managed-by: {{ $.Release.Service }} - app.kubernetes.io/part-of: {{ $chart_name }} -spec: - project: {{ .project }} - source: - repoURL: {{ .git.url }} - targetRevision: {{ .git.branch }} - path: {{ .git.path }} - helm: - valueFiles: -{{ toYaml .value_files | indent 6 }} - destination: - server: {{ .destination.server | default "https://kubernetes.default.svc"}} - namespace: {{ .destination.namespace }} ---- -{{- end }} diff --git a/applications-helm/templates/argocd-cm.yaml b/applications-helm/templates/argocd-cm.yaml deleted file mode 100644 index a50411e..0000000 --- a/applications-helm/templates/argocd-cm.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: argocd-cm - namespace: {{ .Values.argo_namespace}} - labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: {{ include "argo-cd.name" . }} -data: - url: {{ .Values.config.url }} -{{- if .Values.config.helmRepositories }} - helm.repositories: | -{{ toYaml .Values.config.helmRepositories | indent 4 }} -{{- end }} -{{- if .Values.config.repositories }} - repositories: | -{{ toYaml .Values.config.repositories | indent 4 }} -{{- end }} -{{- if .Values.config.oidcConfig }} - oidc.config: | -{{ toYaml .Values.config.oidcConfig | indent 4 }} -{{- end }} diff --git a/applications-helm/templates/argocd-rbac-cm.yaml b/applications-helm/templates/argocd-rbac-cm.yaml deleted file mode 100644 index 3fc2b1d..0000000 --- a/applications-helm/templates/argocd-rbac-cm.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: argocd-rbac-cm - namespace: {{ .Values.argo_namespace}} - labels: - app.kubernetes.io/name: {{ include "argo-cd.name" . }} - helm.sh/chart: {{ include "argo-cd.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/part-of: {{ include "argo-cd.name" . }} -data: -{{- if .Values.rbac.policyDefault }} - policy.default: {{ .Values.rbac.policyDefault }} -{{- end }} -{{- if .Values.rbac.policyCsv }} - policy.csv: -{{- toYaml .Values.rbac.policyCsv | indent 4 }} -{{- end }} diff --git a/applications-helm/templates/project.yaml b/applications-helm/templates/project.yaml deleted file mode 100644 index d0170ec..0000000 --- a/applications-helm/templates/project.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- $namespace := .Values.argo_namespace -}} -{{- $chart_name := include "argo-cd.name" . -}} -{{- $chart := include "argo-cd.chart" . -}} - -{{- range .Values.projects }} -apiVersion: argoproj.io/v1alpha1 -kind: AppProject -metadata: - name: {{ .name }} - namespace: {{ $namespace }} -labels: - app.kubernetes.io/name: {{ $chart_name }} - helm.sh/chart: {{ $chart }} - app.kubernetes.io/instance: {{ $.Release.Name }} - app.kubernetes.io/managed-by: {{ $.Release.Service }} - app.kubernetes.io/part-of: {{ $chart_name }} -spec: - description: {{ .description }} - sourceRepos: - {{ toYaml .sourceRepos | indent 2 -}} - destinations: - {{- range .destinations }} - - namespace: {{ .namespaces }} - server: {{.server | default "https://kubernetes.default.svc" }} - {{- end }} - - {{- if .clusterResourceWhitelist }} - clusterResourceWhitelist: -{{ toYaml .clusterResourceWhitelist| indent 2 }} - {{- end }} - - roles: - {{- range .roles }} - - name: {{ .name }} - description: {{ .description }} - policies: -{{ toYaml .policies| indent 6 }} - jwtTokens: -{{ toYaml .jwtTokens| indent 6 }} - groups: -{{ toYaml .oidcGroups| indent 6 -}} - {{- end }} - ---- -{{- end }} diff --git a/applications-helm/values-global.yaml b/applications-helm/values-global.yaml deleted file mode 100644 index 8101715..0000000 --- a/applications-helm/values-global.yaml +++ /dev/null @@ -1,46 +0,0 @@ -argo_namespace: argocd - -config: - helmRepositories: - - name: private-helm-repo - url: https://private.repo/ - usernameSecret: - name: secret_name - key: key_name - passwordSecret: - name: secret_name - key: key_name - - name: incubator - url: https://kubernetes-charts-incubator.storage.googleapis.com/ - repositories: - - url: repo_url - sshPrivateKeySecret: #the chart doesn't install the secert - name: secret_name - key: key_name - -rbac: -# See https://github.com/argoproj/argo-cd/blob/master/docs/rbac.md on how to write RBAC policies. -# This will effacte on all argocd instances - policyCsv: | - g, role_name, role:admin - policyDefault: role:readonly - -projects: - - name: project_name - destinations: - - namespaces: [namespace] - #server: https://kubernetes.default.svc - description: description - sourceRepos: - - 'repo_url' - #clusterResourceWhitelist: - #- group: '*' - # kind: '*' - roles: - - name: role_name - description: role_description - oidcGroups: [' grop_name'] - policies: | - - jwtTokens: - - iat: 123 diff --git a/applications-helm/values-production.yaml b/applications-helm/values-production.yaml deleted file mode 100644 index d0916e8..0000000 --- a/applications-helm/values-production.yaml +++ /dev/null @@ -1,19 +0,0 @@ -config: - url: https://argocd_url - #idcConfig: - # name: Okta - # clientID: - # clientSecret: - # issuer: - -applications: - - name: app_name - project: project - destination: - namespace: namespace - git: - url: url - branch: branch - path: path #path to the value file - value_files: - - values-production.yaml diff --git a/applications-helm/values-staging.yaml b/applications-helm/values-staging.yaml deleted file mode 100644 index ffe69e6..0000000 --- a/applications-helm/values-staging.yaml +++ /dev/null @@ -1,19 +0,0 @@ -config: - url: https://argocd_url - #idcConfig: - # name: Okta - # clientID: - # clientSecret: - # issuer: - -applications: - - name: app_name - project: project - destination: - namespace: namespace - git: - url: url - branch: branch - path: path #path to the value file - value_files: - - values-staging.yaml diff --git a/applications/Chart.yaml b/apps/Chart.yaml similarity index 100% rename from applications/Chart.yaml rename to apps/Chart.yaml diff --git a/applications/templates/guestbook.yaml b/apps/templates/guestbook.yaml similarity index 100% rename from applications/templates/guestbook.yaml rename to apps/templates/guestbook.yaml diff --git a/applications/templates/helm-dependency.yaml b/apps/templates/helm-dependency.yaml similarity index 100% rename from applications/templates/helm-dependency.yaml rename to apps/templates/helm-dependency.yaml diff --git a/applications/templates/helm-guestbook.yaml b/apps/templates/helm-guestbook.yaml similarity index 100% rename from applications/templates/helm-guestbook.yaml rename to apps/templates/helm-guestbook.yaml diff --git a/applications/templates/kustomize-guestbook.yaml b/apps/templates/kustomize-guestbook.yaml similarity index 100% rename from applications/templates/kustomize-guestbook.yaml rename to apps/templates/kustomize-guestbook.yaml diff --git a/applications/values.yaml b/apps/values.yaml similarity index 100% rename from applications/values.yaml rename to apps/values.yaml