Skip to content

Instantly share code, notes, and snippets.

@cirocosta
Created August 19, 2022 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirocosta/0e1884803451058d7dbc07ff12d20095 to your computer and use it in GitHub Desktop.
Save cirocosta/0e1884803451058d7dbc07ff12d20095 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: Namespace
metadata:
name: git-serve-controller
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: git-serve-controller
namespace: git-serve-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: git-serve-controller
rules:
- apiGroups:
- ops.tips
resources:
- '*'
verbs:
- '*'
- apiGroups:
- ""
resources:
- secrets
- services
- events
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: git-serve-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: git-serve-controller
subjects:
- kind: ServiceAccount
name: git-serve-controller
namespace: git-serve-controller
---
apiVersion: v1
data:
image: ghcr.io/cirocosta/git-serve@sha256:a130e031bccb2e3e31eefe6186965ca4788f787d5344f7a4904fbe6c64c243aa
kind: ConfigMap
metadata:
name: git-serve-controller
namespace: git-serve-controller
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: git-serve-controller
namespace: git-serve-controller
spec:
replicas: 1
selector:
matchLabels:
control-plane: git-serve-controller
template:
metadata:
labels:
control-plane: git-serve-controller
spec:
containers:
- args:
- git-serve-controller
env:
- name: GIT_SERVE_DEFAULT_IMAGE
valueFrom:
configMapKeyRef:
key: image
name: git-serve-controller
image: ghcr.io/cirocosta/git-serve@sha256:a130e031bccb2e3e31eefe6186965ca4788f787d5344f7a4904fbe6c64c243aa
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: git-serve-controller
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true
serviceAccountName: git-serve-controller
terminationGracePeriodSeconds: 10
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: gitservers.ops.tips
spec:
group: ops.tips
names:
kind: GitServer
listKind: GitServerList
plural: gitservers
singular: gitserver
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.address.url
name: URL
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- jsonPath: .status.conditions[?(@.type=="Ready")].reason
name: Reason
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
http:
properties:
auth:
properties:
password:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
username:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
type: object
required:
- auth
type: object
image:
description: Image is the image to use for the deployment of gitserver.
type: string
ssh:
description: HTTP *GitServerSpecHTTP `json:"http,omitempty"`
properties:
auth:
properties:
authorizedKeys:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
hostKey:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
type: object
required:
- auth
type: object
type: object
status:
description: GitServerStatus defines the observed state of GitServer
properties:
address:
properties:
url:
type: string
type: object
conditions:
description: Conditions the latest available observations of a resource's
current state.
items:
description: 'Conditions defines a readiness condition for a Knative
resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#typical-status-properties'
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another. We use VolatileTime
in place of metav1.Time to exclude this from creating equality.Semantic
differences (all other things held constant).
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
severity:
description: Severity with which to treat failures of this type
of condition. When this is not specified, it defaults to Error.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- status
- type
type: object
type: array
deploymentRef:
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in
the core API group. For any other third-party types, APIGroup
is required.
nullable: true
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
observedGeneration:
description: ObservedGeneration is the 'Generation' of the Service
that was last processed by the controller.
format: int64
type: integer
secretRef:
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in
the core API group. For any other third-party types, APIGroup
is required.
nullable: true
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
serviceRef:
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in
the core API group. For any other third-party types, APIGroup
is required.
nullable: true
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment