This file contains hidden or 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
#!/bin/bash | |
# Get your API key from https://www.cloudflare.com/a/account/my-account | |
API_KEY="your-api-key" | |
EMAIL="[email protected]" | |
# Strip only the top domain to get the zone id | |
DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)') | |
# Get the Cloudflare zone id |
This file contains hidden or 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/v1 | |
kind: Ingress | |
metadata: | |
name: RELEASE-NAME-demo | |
labels: | |
helm.sh/chart: demo-0.1.0 | |
app.kubernetes.io/name: demo | |
app.kubernetes.io/instance: RELEASE-NAME | |
app.kubernetes.io/version: "k8s" | |
app.kubernetes.io/managed-by: Helm |
This file contains hidden or 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: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-prod | |
namespace: cert-manager | |
spec: | |
acme: | |
# The ACME server URL | |
server: https://acme-v02.api.letsencrypt.org/directory | |
# Email address used for ACME registration |
This file contains hidden or 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: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-staging | |
namespace: cert-manager | |
spec: | |
acme: | |
# The ACME server URL | |
server: https://acme-staging-v02.api.letsencrypt.org/directory | |
# Email address used for ACME registration |
This file contains hidden or 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
for i in yuswitayudi | |
do | |
openssl genrsa -out $i.key 2048 | |
openssl req -new -key $i.key -out $i.csr -subj "/CN=$i/O=finance" | |
openssl x509 -req -in $i.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out $i.crt -days 365 | |
kubectl --kubeconfig $i.config config set-cluster kubernetes-dev --server https://192.168.1.223:6443 --certificate-authority=ca.crt | |
kubectl --kubeconfig $i.config config set-credentials $i --client-certificate $i.crt --client-key $i.key | |
kubectl --kubeconfig $i.config config set-context $i-dev --cluster kubernetes-dev --namespace dev --user=$i | |
kubectl --kubeconfig $i.config config use-context $i-dev | |
kubectl create role $i-dev --verb=* --resource=*.* --namespace dev |
This file contains hidden or 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
https://yuswitayudi.github.io |
This file contains hidden or 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
#!/bin/bash | |
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine | |
# Used to provide DDNS service for my home | |
# Needs the DNS record pre-creating on Cloudflare | |
# Proxy - uncomment and provide details if using a proxy | |
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport> | |
# Cloudflare zone is the zone which holds the record |
This file contains hidden or 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
FROM nginx:alpine | |
COPY index.html /usr/share/nginx/html |
This file contains hidden or 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
//define docker provider | |
terraform { | |
required_providers { | |
docker = { | |
source = "kreuzwerker/docker" | |
version = "2.15.0" | |
} | |
} | |
} |
This file contains hidden or 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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
NewerOlder