Skip to content

Commit

Permalink
Removing environment config variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoralespou committed Oct 5, 2023
1 parent 8f2143b commit bdeece8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-sample-manifest-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
--file ./test/portal-app/workshops/${{ matrix.bundle }} \
--image ghcr.io/${REPOSITORY_OWNER}/${REPOSITORY_NAME}:${REPOSITORY_TAG}
env:
REPOSITORY_TAG: ${{ steps.version.outputs.version}}
REPOSITORY_TAG: ${{ steps.version.outputs.version }}

- name: Install crane
uses: imjasonh/[email protected]
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,13 @@ It will remove the carvel application and dependent config and security config.
This will produce a list of Carvel Apps with the required k8s credentials and configuration for courses, workshops, ....

```
ytt -v environment=test \
-v mode=app_per_bundle \
ytt -v mode=app_per_bundle \
--data-values-file test/gitops-app/versions.yaml \
-f overlays/gitops-app/src/bundle/config
```

```
ytt -v environment=test \
-v mode=one_app \
ytt -v mode=one_app \
--data-values-file test/gitops-app/versions.yaml \
-f overlays/gitops-app/src/bundle/config
```
Expand Down
2 changes: 0 additions & 2 deletions overlays/gitops-app/src/bundle/config/values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#@schema/validation one_of=["app_per_bundle", "one_app"]
mode: "app_per_bundle"
#@schema/validation min_len=1
environment: ""
#@schema/validation min_len=1
syncPeriod: "0h10m0s"
overlays:
#@schema/validation min_len=1
Expand Down
10 changes: 2 additions & 8 deletions resources/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ kind: App
metadata:
name: workshops-gitops
namespace: package-installs
annotations:
educates_gitops_environment: "sample-environment"
spec:
serviceAccountName: workshops-gitops-package-installs
syncPeriod: "0h2m0s"
Expand All @@ -18,18 +16,14 @@ spec:
url: https://github.com/educates/educates-workshop-gitops-configurer
ref: origin/main
subPath: "config/sample-environment"
path: environments
path: environment
template:
- ytt:
ignoreUnknownComments: true
paths:
- config
valuesFrom:
- path: environments/versions.yaml
- downwardAPI:
items:
- name: environment
fieldPath: metadata.annotations['educates_gitops_environment']
- path: environment/versions.yaml
deploy:
- kapp:
rawOptions: ["--app-changes-max-to-keep=5", "--wait-timeout=5m"]
1 change: 0 additions & 1 deletion test/gitops-app/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ overlays:
config:
url: https://github.com/educates/educates-workshop-gitops-configurer
ref: origin/test-branch
subPath: environment
credentials:
# username: "jorgemoralespou"
# password: "xxyyzzxxyyzzxxyyzzxxyyzz"
Expand Down
48 changes: 48 additions & 0 deletions vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Examples from: https://external-secrets.io/latest/provider/hashicorp-vault/
---
apiVersion: v1
kind: Secret
metadata:
name: vault-token
stringData:
token: hvs.CAESIEgpCku8AQFMhtjg1T1U0jZfZB7RF1TzYeu6bJOx7DhyGh4KHGh2cy5NT0RJVW5BNmhoYXVSNVNRaGNBazFudks
---
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: vault-backend
spec:
provider:
vault:
server: "https://vault.console.cerberus.vmware.com/3cc42480-60bc-49a0-9f2f-2f77c049a6cb"
path: "secret"
# Version is the Vault KV secret engine version.
# This can be either "v1" or "v2", defaults to "v2"
version: "v2"
auth:
# points to a secret that contains a vault token
# https://www.vaultproject.io/docs/auth/token
tokenSecretRef:
name: "vault-token"
key: "token"
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: vault-example
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault-backend
kind: SecretStore
target:
name: example-sync
data:
- secretKey: access-key-id
remoteRef:
key: /aws
property: access-key-id
- secretKey: service-account-user
remoteRef:
key: /aws
property: service-account-user

0 comments on commit bdeece8

Please sign in to comment.