-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: environments #41
Changes from 6 commits
7f6b387
ec5d7e4
58712c2
9df3628
45d9020
f053324
0f5c4e1
116e862
3a27e9f
39e0ba4
f8ec529
b07b866
342a2fe
9f01e80
662d9c3
5f169a5
5982c30
07fe15a
e60cc87
e3c1047
71abd1c
c5d7f88
f5d58eb
897e87c
d66aa9a
8139c20
6499cef
bc8260b
a797827
8688694
5c0a9fd
f91e411
267a70e
1348830
a0343bc
305feb0
3dd6596
6f773fc
0fb3745
89c73a0
31fffe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
configMapGenerator: | ||
- behavior: replace | ||
files: | ||
- values=override_config_hello_world.yaml | ||
name: ${cluster_id}-hello-world-values | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
kind: Kustomization | ||
resources: | ||
- ../../../../app_sets/hello-web-app/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
admin_login: hello-admin-in-cluster-template | ||
db_config: | ||
db_port: 5433 # has to be in sync with config in default_config_simple_db.yaml | ||
db_user: hello-web-app # has to be in sync with config in default_config_simple_db.yaml | ||
host: simple-db.simple-web.svc # has to be in sync with 'namespace:' set in kustomization.yaml | ||
thread_pool_size: 64 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
data: | ||
values: | | ||
cloudConfig: cloud-config-giantswarm-2 | ||
cloudName: openstack | ||
externalNetworkID: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee | ||
kind: ConfigMap | ||
metadata: | ||
name: ${cluster_name}-user-config | ||
namespace: org-${organization} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
commonLabels: | ||
giantswarm.io/managed-by: flux | ||
kind: Kustomization | ||
patchesStrategicMerge: | ||
- patch_user_config.yaml | ||
resources: | ||
- ../../../clusters/capo/>=v0.6.0 | ||
- cluster_user_config.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: application.giantswarm.io/v1alpha1 | ||
kind: App | ||
metadata: | ||
name: ${cluster_name} | ||
namespace: org-${organization} | ||
spec: | ||
userConfig: | ||
configMap: | ||
name: ${cluster_name}-user-config | ||
namespace: org-${organization} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
kind: Kustomization | ||
resources: | ||
- cluster/ | ||
- app_sets/hello-web-app/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: application.giantswarm.io/v1alpha1 | ||
kind: Catalog | ||
metadata: | ||
labels: | ||
application.giantswarm.io/catalog-visibility: internal | ||
name: giantswarm-catalog-oci | ||
namespace: org-${organization} | ||
spec: | ||
description: giantswarm-catalog-oci | ||
logoURL: "https://avatars.githubusercontent.com/u/7556340?s=60&v=4" | ||
storage: | ||
URL: oci://giantswarmpublic.azurecr.io/giantswarm-catalog/ | ||
type: helm | ||
title: giantswarm-catalog-oci |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, we want more critera than just 'deployment stage', like for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had exactly the same idea, but figured There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we change this to |
||
kind: ImageUpdateAutomation | ||
metadata: | ||
name: ${cluster_id}-image-updates | ||
namespace: org-${organization} | ||
spec: | ||
git: | ||
checkout: | ||
ref: | ||
branch: main | ||
commit: | ||
author: | ||
email: [email protected] | ||
name: fluxcdbot | ||
messageTemplate: | | ||
automated app upgrades: | ||
{{ range $image, $_ := .Updated.Images -}} | ||
- {{ $image.Repository }} to {{ $image.Identifier }} | ||
{{ end -}} | ||
push: | ||
branch: main | ||
interval: 1m0s | ||
sourceRef: | ||
kind: GitRepository | ||
name: YOUR_GIT_REPO | ||
update: | ||
path: ./management-clusters/MC_NAME | ||
strategy: Setters |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
commonLabels: | ||
giantswarm.io/managed-by: flux | ||
kind: Kustomization | ||
resources: | ||
- catalog.yaml | ||
- imageupdate.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thread_pool_size: 16 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImagePolicy | ||
metadata: | ||
name: ${cluster_id}-hello-app | ||
spec: | ||
filterTags: | ||
pattern: '.*-dev.*' | ||
imageRepositoryRef: | ||
name: ${cluster_id}-hello-app | ||
policy: | ||
semver: | ||
range: '>=0.1.0' | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImagePolicy | ||
metadata: | ||
name: ${cluster_id}-simple-db-app | ||
spec: | ||
imageRepositoryRef: | ||
name: ${cluster_id}-simple-db | ||
policy: | ||
semver: | ||
range: '>=0.1.0 <0.2.0' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImageRepository | ||
metadata: | ||
name: ${cluster_id}-hello-app | ||
spec: | ||
image: giantswarmpublic.azurecr.io/giantswarm-catalog/hello-world-app | ||
interval: 10m0s | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImageRepository | ||
metadata: | ||
name: ${cluster_id}-simple-db-app | ||
spec: | ||
image: giantswarmpublic.azurecr.io/giantswarm-catalog/simple-db-app | ||
interval: 10m0s |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
configMapGenerator: | ||
- behavior: create | ||
files: | ||
- values=hello_world_app_user_config.yaml | ||
name: ${cluster_id}-hello-world-user-config | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
kind: Kustomization | ||
# (optional) here we can enforce versions for both component of the app that we want in prod | ||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: '0.1.8 # {"$imagepolicy": "org-${organization}:${cluster_id}-hello-app"}' | ||
target: | ||
kind: App | ||
name: \${cluster_id}-hello-world | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: '0.1.0 # {"$imagepolicy": "org-${organization}:${cluster_id}-simple-db-app"}' | ||
target: | ||
kind: App | ||
name: \${cluster_id}-simple-db | ||
# block end | ||
resources: | ||
- automatic_updates/ | ||
- imagepolicies.yaml | ||
- imagerepositories.yaml | ||
- ../../../../cluster_templates/hello_app_cluster |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
values: | | ||
cloudConfig: cloud-config-giantswarm-2 | ||
cloudName: openstack | ||
externalNetworkID: prod-bbbb-cccc-dddd-eeeeeeeeeeee | ||
nodeClasses: | ||
- bootFromVolume: true | ||
diskSize: 150 | ||
flavor: n1.large | ||
image: dddddddd-dddd-dddd-dddd-dddddddddddd | ||
name: default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thread_pool_size: 256 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
configMapGenerator: | ||
- behavior: create | ||
files: | ||
- values=hello_world_app_user_config.yaml | ||
name: ${cluster_id}-hello-world-user-config | ||
- behavior: replace | ||
files: | ||
- values=cluster_user_config.yaml | ||
name: ${cluster_name}-user-config | ||
namespace: org-${organization} | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
kind: Kustomization | ||
# (optional) here we can enforce versions for both component of the app that we want in prod | ||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: 0.1.8 | ||
target: | ||
kind: App | ||
name: \${cluster_id}-hello-world | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: 0.1.0 | ||
target: | ||
kind: App | ||
name: \${cluster_id}-simple-db | ||
# block end | ||
resources: | ||
- ../../../../cluster_templates/hello_app_cluster |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: application.giantswarm.io/v1alpha1 | ||
kind: Catalog | ||
metadata: | ||
labels: | ||
application.giantswarm.io/catalog-visibility: internal | ||
name: giantswarm-catalog-oci | ||
namespace: org-${organization} | ||
spec: | ||
description: giantswarm-catalog-oci | ||
logoURL: "https://avatars.githubusercontent.com/u/7556340?s=60&v=4" | ||
storage: | ||
URL: oci://giantswarmpublic.azurecr.io/giantswarm-catalog/ | ||
type: helm | ||
title: giantswarm-catalog-oci |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImageUpdateAutomation | ||
metadata: | ||
name: ${cluster_id}-image-updates | ||
namespace: org-${organization} | ||
spec: | ||
git: | ||
checkout: | ||
ref: | ||
branch: main | ||
commit: | ||
author: | ||
email: [email protected] | ||
name: fluxcdbot | ||
messageTemplate: | | ||
automated app upgrades: | ||
{{ range $image, $_ := .Updated.Images -}} | ||
- {{ $image.Repository }} to {{ $image.Identifier }} | ||
{{ end -}} | ||
push: | ||
branch: main | ||
interval: 1m0s | ||
sourceRef: | ||
kind: GitRepository | ||
name: YOUR_GIT_REPO | ||
update: | ||
path: ./management-clusters/MC_NAME | ||
strategy: Setters |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
commonLabels: | ||
giantswarm.io/managed-by: flux | ||
kind: Kustomization | ||
resources: | ||
- catalog.yaml | ||
- imageupdate.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thread_pool_size: 64 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImagePolicy | ||
metadata: | ||
name: ${cluster_id}-hello-app | ||
spec: | ||
imageRepositoryRef: | ||
name: ${cluster_id}-hello-app | ||
policy: | ||
semver: | ||
range: '>=0.1.0 <1.0.0' | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImagePolicy | ||
metadata: | ||
name: ${cluster_id}-simple-db-app | ||
spec: | ||
imageRepositoryRef: | ||
name: ${cluster_id}-simple-db | ||
policy: | ||
semver: | ||
range: '>=0.1.0 <0.2.0' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImageRepository | ||
metadata: | ||
name: ${cluster_id}-hello-app | ||
spec: | ||
image: giantswarmpublic.azurecr.io/giantswarm-catalog/hello-world-app | ||
interval: 10m0s | ||
--- | ||
apiVersion: image.toolkit.fluxcd.io/v1beta1 | ||
kind: ImageRepository | ||
metadata: | ||
name: ${cluster_id}-simple-db-app | ||
spec: | ||
image: giantswarmpublic.azurecr.io/giantswarm-catalog/simple-db-app | ||
interval: 10m0s |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
configMapGenerator: | ||
- behavior: create | ||
files: | ||
- values=hello_world_app_user_config.yaml | ||
name: ${cluster_id}-hello-world-user-config | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
kind: Kustomization | ||
# (optional) here we can enforce versions for both component of the app that we want in prod | ||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: '0.1.8 # {"$imagepolicy": "org-${organization}:${cluster_id}-hello-app"}' | ||
target: | ||
kind: App | ||
name: \${cluster_id}-hello-world | ||
- patch: |- | ||
- op: replace | ||
path: /spec/version | ||
value: '0.1.0 # {"$imagepolicy": "org-${organization}:${cluster_id}-simple-db-app"}' | ||
target: | ||
kind: App | ||
name: \${cluster_id}-simple-db | ||
# block end | ||
resources: | ||
- automatic_updates/ | ||
- imagepolicies.yaml | ||
- imagerepositories.yaml | ||
- ../../../../cluster_templates/hello_app_cluster |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 | ||
kind: Kustomization | ||
metadata: | ||
name: clusters-CAPI_WC_NAME | ||
namespace: default | ||
spec: | ||
interval: 1m | ||
path: "./management-clusters/MC_NAME/organizations/ORG_NAME/workload-clusters/HELLO_APP_DEV_CLUSTER_1" | ||
postBuild: | ||
substitute: | ||
cluster_domain: "MY_DOMAIN" | ||
cluster_id: "HELLO_DEV_1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming here is really inconsistent. |
||
cluster_name: "HELLO_DEV_1" | ||
cluster_release: "0.8.1" | ||
default_apps_release: "0.2.0" | ||
organization: "ORG_NAME" | ||
prune: false | ||
serviceAccountName: automation | ||
sourceRef: | ||
kind: GitRepository | ||
name: REPO_NAME | ||
timeout: 2m |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
buildMetadata: [originAnnotations] | ||
kind: Kustomization | ||
resources: | ||
- ../../../../../../bases/environments/deployments/dev/hello_app_cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are changes in the
app_sets
subfolder needed in this PR? It seems like a separate area to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in
cluster_templates
, not baseapp_sets
. Tunes the app_set for thisclsuter_template
.