Skip to content

Instantly share code, notes, and snippets.

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

Anderson Caxias andersonkxiass

🏠
Working from home
View GitHub Profile
{
"users": [
{
"name": "alice",
"roles": [
"admin"
]
},
{
"name": "bob",
package app.rbac
default allow = false
default user_is_admin = false
# We need to import our data source reference
import data.source
#Checking if user is admin
allow {
version: '3.3'
services:
opa:
image: openpolicyagent/opa:latest
ports:
- 8181:8181
# WARNING: OPA is NOT running with an authorization policy configured. This
# means that clients can read and write policies in OPA. If you are
# deploying OPA in an insecure environment, be sure to configure
# authentication and authorization on the daemon. See the Security page for
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-nodeport
namespace: kubernetes-dashboard
spec:
type: NodePort
ports:
---
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
INSERT INTO lists (title) VALUES ('Foods'),
('Places'),
('Gifts'),
('Guitars'),
('Cars');
INSERT INTO wishes (description, wish_refer) VALUES ('Sushi', 1),
('Pizza', 1),
('Paris', 2),
('London', 2),
apiVersion: apps/v1
kind: Deployment
metadata:
name: wishapp
namespace: default
labels:
app: app
name: wishapp
spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: wishapi
namespace: default
labels:
app: api
name: wishapi
spec:
apiVersion: v1
kind: Secret
metadata:
name: pg-credentials
type: Opaque
data:
user: cG9zdGdyZXM=
password: cGFzcw==
---