Skip to content

Instantly share code, notes, and snippets.

View juanluisbaptiste's full-sized avatar
🏠
Working from home

Juan Luis Baptiste juanluisbaptiste

🏠
Working from home
View GitHub Profile
@juanluisbaptiste
juanluisbaptiste / java.nomad
Created December 16, 2022 04:59
Example of a Java application Nomad job
job "java_test" {
datacenters = ["dc1"]
group "java_test" {
task "java_test" {
driver = "java"
artifact {
source = "https://github.com/juanluisbaptiste/nomad-demo/raw/master/java/nomad_demo.jar"
destination = "local/"
# options {
@juanluisbaptiste
juanluisbaptiste / ping.nomad
Created December 14, 2022 20:58
Example of a static binary Nomad job
job "ping_test" {
datacenters = ["dc1"]
group "ping_test" {
task "ping" {
driver = "raw_exec"
config {
# When running a binary that exists on the host, the path must be absolute/
command = "/usr/bin/ping"
@juanluisbaptiste
juanluisbaptiste / example.nomad
Created September 20, 2022 03:00
Example Nomad job
job "example" {
datacenters = ["dc1"]
group "cache" {
network {
port "db" {
to = 6379
}
}
@juanluisbaptiste
juanluisbaptiste / nomad_client.hcl
Last active December 13, 2022 02:17
Nomad example client configuration file
data_dir = "/opt/nomad/data"
bind_addr = "0.0.0.0"
datacenter = "dc1"
# Enable the client
client {
enabled = true
options {
"driver.raw_exec.enable" = "1"
"docker.privileged.enabled" = "true"
@juanluisbaptiste
juanluisbaptiste / nomad.hcl
Last active December 13, 2022 02:17
Nomad example server configuration file
data_dir = "/opt/nomad/data"
bind_addr = "0.0.0.0"
# Enable the server
server {
enabled = true
bootstrap_expect = SERVER_COUNT
}
consul {
@juanluisbaptiste
juanluisbaptiste / nomad.service
Last active September 20, 2022 01:52
Nomad systemd service file
[Unit]
Description=Nomad
Documentation=https://nomadproject.io/docs/
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=10
StartLimitBurst=3
# If you are running Consul, please uncomment following Wants/After configs.
# Assuming your Consul service unit name is "consul"
@juanluisbaptiste
juanluisbaptiste / frontend-deployment.yaml
Created September 2, 2022 21:57
Modified guestbook application Deployment manifest
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 3
selector:
matchLabels:
app: guestbook
@juanluisbaptiste
juanluisbaptiste / .drone.secrets.example.yaml
Created September 1, 2022 02:44
Example of Drone.io secret resources to read secrets from an external resource
---
kind: secret
name: docker_username
get:
path: docker
name: username
---
kind: secret
name: docker_password
get:
@juanluisbaptiste
juanluisbaptiste / kubernetes.secrets-example.yaml
Last active September 2, 2022 21:24
Example of a Kubernetes secrets manifest file
---
apiVersion: v1
kind: Secret
metadata:
name: docker
type: Opaque
data:
username: <base64_encoded_value>
password: <base64_encoded_value>
---
@juanluisbaptiste
juanluisbaptiste / drone-kubernetes-secrets.yaml
Created September 1, 2022 02:35
Drone.io Kubernetes secrets extensions example file
rbac:
## The namespace that the extension is allowed to fetch secrets from. Unless
## rbac.restrictToSecrets is set below, the extension will be able to pull all secrets in
## the namespace specified here.
##
secretNamespace: default
## The keys within the "env" map are mounted as environment variables on the secrets extension pod.
##
env:
## REQUIRED: Shared secret value for comms between the Kubernetes runner and this secrets plugin.