-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a kustomize base to the repository (#144)
Adds a [kustomize application][1] that stands up a running instance of go-httpbin in a Kubernetes cluster. This is useful to reference as a remote kustomization via your own kustomization, or can be used as: kustomize build github.com/mccutchen/go-httpbin/kustomize | kubectl apply -f - or even as: kubectl apply -k github.com/mccutchen/go-httpbin/kustomize [1]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#application
- Loading branch information
1 parent
dd8fc10
commit 06f6727
Showing
4 changed files
with
89 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,39 @@ | ||
This folder is a [kustomize application](https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#application) that stands up a running instance of go-httpbin in a Kubernetes cluster. | ||
|
||
You may wish to utilise this as a [remote application](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/resource/), e.g. | ||
|
||
```yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
app.kubernetes.io/name: httpbin | ||
resources: | ||
- github.com/mccutchen/go-httpbin/kustomize | ||
images: | ||
- name: mccutchen/go-httpbin | ||
``` | ||
To expose your instance to the internet, you could add an `Ingress` in an overlay: | ||
```yaml | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: httpbin | ||
spec: | ||
ingressClassName: myingressname | ||
rules: | ||
- host: my-go-httpbin.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: httpbin | ||
port: | ||
name: http | ||
tls: | ||
- hosts: | ||
- my-go-httpbin.com | ||
secretName: go-httpbin-tls | ||
``` |
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,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
app.kubernetes.io/name: httpbin | ||
resources: | ||
- resources.yaml | ||
images: | ||
- name: mccutchen/go-httpbin |
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,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: httpbin | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: httpbin | ||
image: mccutchen/go-httpbin | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /status/200 | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: /status/200 | ||
port: http | ||
resources: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: httpbin | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http |