Example helloworld test web application
Last updated 2023-02-24
This uses the helloworld
example included with the Signal Sciences Golang module as a test web application named helloworld
.
See main.go
in the sigsci-module-golang
helloworld
example.
Dockerfile
Dockerfile to build the signalsciences/example-helloworld
container:
$ docker build . -t signalsciences/example-helloworld:latest
1FROM golang:1.132
3# Image metadata4LABEL com.signalsciences.sigsci-module-golang.examples="helloworld"5LABEL maintainer="Signal Sciences <support@fastly.com>"6
7# Install sigsci golang module (with examples)8RUN go get github.com/signalsciences/sigsci-module-golang9
10# Use the helloworld example as the test app11WORKDIR /go/src/github.com/signalsciences/sigsci-module-golang/examples12
13ENTRYPOINT [ "go", "run", "./helloworld" ]
Kubernetes deployment file
Kubernetes example-helloworld
deployment file (without the Signal Sciences Agent):
$ kubectl apply -f example-helloworld.yaml
1apiVersion: v12kind: Service3metadata:4 name: helloworld5 labels:6 app: helloworld7spec:8 ports:9 - name: http10 port: 800011 targetPort: 800012 selector:13 app: helloworld14 type: LoadBalancer15---16apiVersion: apps/v117kind: Deployment18metadata:19 name: helloworld20 labels:21 app: helloworld22spec:23 replicas: 224 selector:25 matchLabels:26 app: helloworld27 template:28 metadata:29 labels:30 app: helloworld31 spec:32 containers:33 - name: helloworld34 image: signalsciences/example-helloworld:latest35 imagePullPolicy: IfNotPresent36 args:37 # Address for the app to listen on38 - localhost:800039 ports:40 - containerPort: 8000
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.