Skip to content

Commit

Permalink
Add localstack to reference implementation
Browse files Browse the repository at this point in the history
This adds localstack, which involves the following:

1) Install localstack as argo application
 This needs patching as the helm chart doesn't expose enough to access
 DNS port. I used kustomize + helmCharts directive in order to do a
 service patch. That required...
2) --enable-helm added to argocd, via configmap.
3) Delegation of localstack DNS to the localstack service, via Coredns
   Corefile
4) Add a new Crossplane ProviderConfig for localstack

This should all be non-breaking changes

One further enhancement I'll be working on is making the providerconfig
selectable in the backstage template, so that a user can select between
targetting localstack or aws proper when generating their app + bucket.

Signed-off-by: Bradon Kanyid (rattboi) <[email protected]>
  • Loading branch information
rattboi committed May 14, 2024
1 parent 830c5ea commit 8c13d5b
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/ref-implementation/coredns/manifests/cm-coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ data:
reload
loadbalance
}
localhost.localstack.cloud:53 {
errors
cache 30
forward . 10.96.100.10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: aws.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: localstack
annotations:
argocd.argoproj.io/sync-wave: "20"
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: local-secret
key: creds
endpoint:
hostnameImmutable: true
url:
type: Static
static: http://localhost.localstack.cloud:4566
22 changes: 22 additions & 0 deletions examples/ref-implementation/localstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: localstack
namespace: argocd
labels:
example: ref-implementation
spec:
project: default
source:
repoURL: cnoe://localstack
targetRevision: HEAD
path: "."
destination:
namespace: localstack
server: "https://kubernetes.default.svc"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
30 changes: 30 additions & 0 deletions examples/ref-implementation/localstack/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: localstack

helmCharts:
- name: localstack
valuesInline:
debug: true
extraEnvVars:
- name: DEFAULT_REGION
value: "us-east-1"
dnsPolicy: "Default"
service:
type: ClusterIP
# Coredns needs a static IP to refer to for delegation
clusterIP: 10.96.100.10
# this effectively disables the external service ports, which can be used for OpenSearch and a few other services
# these don't play well with the services kustomize patch at this point
# see https://docs.localstack.cloud/references/external-ports/ for more details
externalServicePorts:
start: 4510
end: 4510
dnsService: true
releaseName: localstack
repo: 'https://localstack.github.io/helm-charts'
version: 0.6.12

patches:
- path: service-patch.yaml
17 changes: 17 additions & 0 deletions examples/ref-implementation/localstack/service-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: localstack
spec:
ports:
- name: edge
port: 4566
targetPort: 4566
- name: dns-tcp
port: 53
targetPort: 53
protocol: TCP
- name: dns-udp
port: 53
targetPort: 53
protocol: UDP
1 change: 1 addition & 0 deletions pkg/controllers/localbuild/resources/argo/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21082,6 +21082,7 @@ subjects:
apiVersion: v1
data:
application.resourceTrackingMethod: annotation
kustomize.buildOptions: --enable-helm
resource.exclusions: |
- kinds:
- ProviderConfigUsage
Expand Down

0 comments on commit 8c13d5b

Please sign in to comment.