Skip to content
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

Add localstack to reference implementation #248

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ spec:
region:
type: string
providerConfigName:
description: Default providerConfig needs AWS creds configured
type: string
default: default
enum:
- default
- localstack
tags:
items:
properties:
Expand Down
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
Comment on lines +35 to +38
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to re-write instead of pointing to a static IP?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#configuration-of-stub-domain-and-upstream-nameserver-using-coredns

see:

Note:
CoreDNS does not support FQDNs for stub-domains and nameservers (eg: "ns.foo.com"). During translation, all FQDN nameservers will be omitted from the CoreDNS config.

I'd rather point at the service, but that's apparently not an option, which is why I went the ClusterIP route.

}
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 hack/argo-cd/argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: argocd-cm
data:
application.resourceTrackingMethod: annotation
kustomize.buildOptions: --enable-helm
resource.exclusions: |
- kinds:
- ProviderConfigUsage
Expand Down
2 changes: 1 addition & 1 deletion hack/argo-cd/generate-manifests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

INSTALL_YAML="pkg/controllers/localbuild/resources/argo/install.yaml"
INGRESS_YAML="pkg/controllers/localbuild/resources/argo/ingress.yaml"
Expand Down
4 changes: 2 additions & 2 deletions hack/embedded-resources.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

DIRECTORIES='argo-cd gitea ingress-nginx'

Expand All @@ -8,4 +8,4 @@ for dir in $DIRECTORIES; do
echo "error running script: ./hack/$dir/generate-manifests.sh"
exit 1
fi
done
done
2 changes: 1 addition & 1 deletion hack/gitea/generate-manifests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

INSTALL_YAML="pkg/controllers/localbuild/resources/gitea/k8s/install.yaml"
Expand Down
2 changes: 1 addition & 1 deletion hack/ingress-nginx/generate-manifests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

INSTALL_YAML="pkg/controllers/localbuild/resources/nginx/k8s/ingress-nginx.yaml"
NGINX_DIR="./hack/ingress-nginx"
Expand Down
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
Loading