Skip to content

Commit

Permalink
Add wego as a helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Thompson committed Feb 8, 2022
1 parent b091349 commit 3567229
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/weave-gitops/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
5 changes: 5 additions & 0 deletions charts/weave-gitops/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: weave-gitops
description: A Helm chart for Kubernetes
version: 1.0.0
appVersion: "v0.6.2"
84 changes: 84 additions & 0 deletions charts/weave-gitops/templates/wego-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: wego-app
namespace: {{.Values.namespace}}
spec:
replicas: 1
template:
metadata:
labels:
app: wego-app
spec:
serviceAccountName: wego-app-service-account
containers:
- name: wego-app
image: "ghcr.io/weaveworks/wego-app:{{.Chart.AppVersion}}"
args: ["ui", "run", "-l", "--helm-repo-namespace","{{.Values.namespace}}"]
ports:
- containerPort: 9001
protocol: TCP
imagePullPolicy: IfNotPresent
selector:
matchLabels:
app: wego-app
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-resources
namespace: {{.Values.namespace}}
subjects:
- kind: ServiceAccount
name: wego-app-service-account
namespace: {{.Values.namespace}}
roleRef:
kind: Role
name: resources-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: resources-reader
namespace: {{.Values.namespace}}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get","create"]
- apiGroups: ["wego.weave.works"]
resources: [ "apps" ]
verbs: [ "*" ]
- apiGroups: ["kustomize.toolkit.fluxcd.io"]
resources: [ "kustomizations" ]
verbs: [ "*" ]
- apiGroups: ["helm.toolkit.fluxcd.io"]
resources: [ "helmreleases" ]
verbs: [ "*" ]
- apiGroups: ["source.toolkit.fluxcd.io"]
resources: [ "helmrepositories" ]
verbs: [ "*" ]
- apiGroups: ["source.toolkit.fluxcd.io"]
resources: [ "gitrepositories" ]
verbs: [ "*" ]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: wego-app-service-account
namespace: {{.Values.namespace}}
secrets:
- name: wego-app-service-account-token
---
apiVersion: v1
kind: Service
metadata:
name: wego-app
namespace: {{.Values.namespace}}
spec:
selector:
app: wego-app
ports:
- protocol: TCP
port: 9001
targetPort: 9001
75 changes: 75 additions & 0 deletions charts/weave-gitops/templates/wego-system.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: apps.wego.weave.works
spec:
group: wego.weave.works
names:
kind: Application
listKind: ApplicationList
plural: apps
singular: app
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Application is the Schema for the applications API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ApplicationSpec defines the desired state of Application
properties:
branch:
description: Branch is the branch in the repository where the k8s yaml files for this application are stored.
type: string
config_url:
description: ConfigRepo is the address of the git repository containing the automation for this application
type: string
deployment_type:
description: DeploymentType is the deployment method used to apply the manifests
enum:
- helm
- kustomize
type: string
helm_target_namespace:
description: HelmTargetNamespace is the namespace in which to deploy an added Helm Chart
type: string
path:
description: Path is the path in the repository where the k8s yaml files for this application are stored.
type: string
source_type:
description: SourceType is the type of repository containing the app manifests
enum:
- helm
- git
type: string
url:
description: URL is the address of the git repository for this application
type: string
type: object
status:
description: ApplicationStatus defines the observed state of Application
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
1 change: 1 addition & 0 deletions charts/weave-gitops/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace: wego-system
10 changes: 10 additions & 0 deletions charts/weave-gitops/wego-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
config: |
FluxNamespace: flux-system
WegoNamespace: {{.Values.namespace}}
kind: ConfigMap
metadata:
creationTimestamp: null
name: weave-gitops-config
namespace: {{.Values.namespace}}

0 comments on commit 3567229

Please sign in to comment.