forked from guacsec/guac
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for using Tilt for local development (guacsec#1021)
* add support for using Tilt for local development: * add K8S manifests for basic stack * enable the use of environment variables in Viper: prefixed with GUAC_ * add an HTTP based healthcheck to the GQL service * integrate Tilt with Kind in GHA for CI Signed-off-by: Jesse White <jwhite08@gmail.com> * remove reference to branch Signed-off-by: Jesse White <jwhite08@gmail.com> * enable the graphql playground and expose 8080 on the service by default Signed-off-by: Jesse White <jwhite08@gmail.com> * move helm chart values to k8s/ folder Signed-off-by: Jesse White <jwhite08@gmail.com> * increase default nats limit to 64MB to be consistent with docker compose deployment Signed-off-by: Jesse White <jwhite08@gmail.com> --------- Signed-off-by: Jesse White <jwhite08@gmail.com>
- Loading branch information
Showing
10 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
**/.entc | ||
**/ent/ | ||
pkg/assembler/clients/generated/ | ||
pkg/assembler/graphql/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
allow_k8s_contexts('kind-kind') | ||
analytics_settings(enable=False) | ||
|
||
load('ext://helm_remote', 'helm_remote') | ||
helm_remote('nats', repo_url='https://nats-io.github.io/k8s/helm/charts/', repo_name='nats', values='k8s/tilt-nats-values.yaml') | ||
|
||
custom_build('local-organic-guac', "export GUAC_IMAGE=\"$EXPECTED_IMAGE\" && make container", deps='pkg/', tag="latest") | ||
k8s_yaml('k8s/k8s.yaml') | ||
|
||
k8s_resource( | ||
workload='guac-collectsub', | ||
resource_deps=['nats'] | ||
) | ||
|
||
k8s_resource( | ||
workload='guac-graphql', | ||
port_forwards=[ | ||
port_forward(8080, 8080, name='graphql') | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: guac-collectsub | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: guac-collectsub | ||
template: | ||
metadata: | ||
labels: | ||
app: guac-collectsub | ||
spec: | ||
containers: | ||
- name: guac-collectsub | ||
image: local-organic-guac | ||
command: ["/opt/guac/guaccsub"] | ||
workingDir: /tmp | ||
ports: | ||
- containerPort: 2782 | ||
readinessProbe: | ||
exec: | ||
command: | ||
- wget | ||
- --spider | ||
- http://localhost:2782 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
timeoutSeconds: 10 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: guac-collectsub | ||
spec: | ||
selector: | ||
app: guac-collectsub | ||
ports: | ||
- protocol: TCP | ||
port: 2782 | ||
targetPort: 2782 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: guac-graphql | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: guac-graphql | ||
template: | ||
metadata: | ||
labels: | ||
app: guac-graphql | ||
spec: | ||
containers: | ||
- name: guac-graphql | ||
image: local-organic-guac | ||
command: ["/opt/guac/guacgql"] | ||
workingDir: /tmp | ||
env: | ||
- name: GUAC_GQL_DEBUG | ||
value: "true" | ||
ports: | ||
- name: http-port | ||
containerPort: 8080 | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: http-port | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
timeoutSeconds: 10 | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: guac-graphql | ||
spec: | ||
selector: | ||
app: guac-graphql | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: guac-ingestor | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: guac-ingestor | ||
template: | ||
metadata: | ||
labels: | ||
app: guac-ingestor | ||
spec: | ||
containers: | ||
- name: guac-ingestor | ||
image: local-organic-guac | ||
command: ["/opt/guac/guacingest"] | ||
workingDir: /tmp | ||
env: | ||
- name: GUAC_NATS_ADDR | ||
value: nats://nats:4222 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: oci-collector | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: oci-collector | ||
template: | ||
metadata: | ||
labels: | ||
app: oci-collector | ||
spec: | ||
containers: | ||
- name: oci-collector | ||
image: local-organic-guac | ||
command: ["/opt/guac/guaccollect", "image"] | ||
workingDir: /tmp | ||
env: | ||
- name: GUAC_NATS_ADDR | ||
value: nats://nats:4222 | ||
- name: GUAC_CSUB_ADDR | ||
value: guac-collectsub:2782 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: depsdev-collector | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: depsdev-collector | ||
template: | ||
metadata: | ||
labels: | ||
app: depsdev-collector | ||
spec: | ||
containers: | ||
- name: depsdev-collector | ||
image: local-organic-guac | ||
command: ["/opt/guac/guaccollect", "deps_dev"] | ||
workingDir: /tmp | ||
env: | ||
- name: GUAC_NATS_ADDR | ||
value: nats://nats:4222 | ||
- name: GUAC_CSUB_ADDR | ||
value: guac-collectsub:2782 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
nats: | ||
image: nats:alpine | ||
|
||
limits: | ||
maxPayload: "64MB" | ||
|
||
jetstream: | ||
enabled: true | ||
|
||
memStorage: | ||
enabled: true | ||
size: "128MB" | ||
|
||
fileStorage: | ||
enabled: false | ||
|
||
cluster: | ||
enabled: false |