Skip to content

Instantly share code, notes, and snippets.

---
apiVersion: v1
kind: Service
metadata:
name: "{{ app_name }}-service"
namespace: "{{ namespace }}"
labels:
app: "{{ app_name }}"
spec:
selector:
---
apiVersion: v1
kind: Service
metadata:
name: "%%app_name%%-service"
namespace: "%%env%%-%%namespace%%"
labels:
app: "%%app_name%%"
spec:
selector:
{%- set mandatory_vars = [prometheus_metrics, application_port, probe_port, env, force_pod_disruption_budget, args, command, app_url] -%}
---
apiVersion: v1
kind: Service
metadata:
name: "{{ app_name }}-service"
namespace: "{{ namespace }}"
labels:
app: "{{ app_name }}"
spec:
{#
{{ variable_that_does_not_exist | default("This is the default String") }}
{{ empty_variable | default("This is the default for the empty variable") }}
{% if empty_variable is not defined %}
It is not defined
{% else %}
Empty Variable: {{ empty_variable }}
{% endif %}
{# This is a comment #}
{# This Template is being used with app local_meza_backend #}
{# This ensures that the variables inside the [] exist #}
{# We do it this way in order to achieve a pretty error message: "awkard_variable" is not set #}
{% set mandatory_variables = [number_to_check, app_name] %}
{% if random_variable_that_does_not_exist %}
random_variable_that_does_not_exist is true
{% else %}
{% set percentage_sign = '%' %}
{{ percentage_sign }}
---
apiVersion: v1
kind: Service
metadata:
name: "{{ app_name }}-service"
namespace: "{{ namespace }}"
labels:
app: "{{ app_name }}"

Keybase proof

I hereby claim:

  • I am miguel-amaral on github.
  • I am miguelamaral (https://keybase.io/miguelamaral) on keybase.
  • I have a public key ASAIs9Y3FGVCrnr6JDb35gdELL4Z9EJayDjMFo8CEmdlkQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am miguel-amaral on github.
  • I am miguelamaral (https://keybase.io/miguelamaral) on keybase.
  • I have a public key ASAIs9Y3FGVCrnr6JDb35gdELL4Z9EJayDjMFo8CEmdlkQo

To claim this, I am signing this object:

echo "Usage sudo redirect.sh http_port https_port"
http_port=$1
https_port=$2
re='^[0-9]+$'
if ! [[ $http_port =~ $re ]] ; then
echo "error: HTTP PORT Not a number" >&2; exit 1
fi
if ! [[ $https_port =~ $re ]] ; then
@miguel-amaral
miguel-amaral / find_portugal_phone_numbers.sh
Created July 20, 2018 19:05
command for findind all phone numbers inside file
grep -o -P "[9][0-9]{8}" fine_name | uniq