-
-
Save shuklaneerajdev/18f8f723de09d39ef9b9dd7043f1f896 to your computer and use it in GitHub Desktop.
Rails Kubernetes Manifests
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: example | |
namespace: default | |
data: | |
APPLICATION_HOST: example.com | |
LANG: en_US.UTF-8 | |
PIDFILE: /tmp/server.pid | |
PORT: "3000" | |
RACK_ENV: production | |
RAILS_ENV: production | |
RAILS_LOG_TO_STDOUT: "true" | |
RAILS_SERVE_STATIC_FILES: "true" |
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
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
generateName: db-migrate- | |
labels: | |
app.kubernetes.io/name: example | |
namespace: default | |
spec: | |
template: | |
metadata: | |
labels: | |
app.kubernetes.io/name: example | |
spec: | |
containers: | |
- command: | |
- rails | |
- db:migrate | |
envFrom: | |
- configMapRef: | |
name: env | |
- secretRef: | |
name: env | |
image: docker.io/mycompany/myapplication:abcd123 | |
imagePullPolicy: IfNotPresent | |
name: main | |
restartPolicy: Never |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app.kubernetes.io/name: example | |
process: web | |
name: example-web | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
app.kubernetes.io/name: example | |
process: web | |
template: | |
metadata: | |
labels: | |
app.kubernetes.io/name: example | |
process: web | |
spec: | |
containers: | |
- env: | |
- name: PORT | |
value: "3000" | |
envFrom: | |
- configMapRef: | |
name: example | |
- secretRef: | |
name: example | |
image: docker.io/mycompany/myapplication:abcd123 | |
imagePullPolicy: IfNotPresent | |
name: main | |
ports: | |
- containerPort: 3000 | |
name: http | |
protocol: TCP | |
readinessProbe: | |
httpGet: | |
httpHeaders: | |
- name: Host | |
value: example.com | |
path: /robots.txt | |
port: 3000 | |
initialDelaySeconds: 10 | |
periodSeconds: 10 | |
timeoutSeconds: 2 | |
initContainers: | |
- command: | |
- rake | |
- db:abort_if_pending_migrations | |
envFrom: | |
- configMapRef: | |
name: example | |
- secretRef: | |
name: example | |
image: docker.io/mycompany/myapplication:abcd123 | |
imagePullPolicy: IfNotPresent | |
name: migrations |
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
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
labels: | |
app.kubernetes.io/name: example | |
name: example | |
namespace: default | |
spec: | |
rules: | |
- host: example.com | |
http: | |
paths: | |
- backend: | |
serviceName: example-web | |
servicePort: 3000 | |
tls: | |
- hosts: | |
- example.com | |
secretName: example-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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app.kubernetes.io/name: example | |
process: web | |
name: example-web | |
namespace: default | |
spec: | |
ports: | |
- name: http | |
port: 3000 | |
protocol: TCP | |
targetPort: http | |
selector: | |
app.kubernetes.io/name: example | |
process: web | |
type: ClusterIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment