Skip to content

Instantly share code, notes, and snippets.

@skinny
Created April 26, 2019 10:55
Show Gist options
  • Save skinny/6636f7f6cae0ecbde55c14129042d8b1 to your computer and use it in GitHub Desktop.
Save skinny/6636f7f6cae0ecbde55c14129042d8b1 to your computer and use it in GitHub Desktop.
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();
local name = 'redis-ha';
local replicas = 3;
local statefulset = import "./components/redis/statefulset.jsonnet";
local announcer = import "./components/redis/announce-service.jsonnet";
{
'00_serviceaccount': kube.ServiceAccount('redis-ha'),
'01_rbac': kube.List() + {
items: [
kube.Role('redis-ha') + {
rules: [
{
apiGroups: [''],
resources: ['endpoints'],
verbs: ['get'],
},
],
},
kube.RoleBinding('redis-ha') + {
roleRef: {
name: 'redis-ha',
kind: 'Role',
apiGroup: 'rbac.authorization.k8s.io',
},
subjects: {
kind: 'ServiceAccount',
name: 'redis-ha'
},
},
],
}
} + statefulset.RedisStatefulSet(name, replicas)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment