Skip to content

Commit

Permalink
Merge pull request #31 from djkormo/chart-test-3
Browse files Browse the repository at this point in the history
 adding misssing directory for chart
  • Loading branch information
djkormo authored Nov 12, 2023
2 parents d484f46 + 81b4954 commit 82facaf
Show file tree
Hide file tree
Showing 18 changed files with 839 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*.so
*.dylib
bin
adcs-issuer
# Test binary, build with `go test -c`
*.test

Expand Down
23 changes: 23 additions & 0 deletions charts/adcs-issuer/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
22 changes: 22 additions & 0 deletions charts/adcs-issuer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: adcs-issuer
description: ADCS issuser plugin for cert-manager
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.4
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.0.4"

62 changes: 62 additions & 0 deletions charts/adcs-issuer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "chart.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "chart.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "chart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "chart.labels" -}}
helm.sh/chart: {{ include "chart.chart" . }}
{{ include "chart.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "chart.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "chart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
87 changes: 87 additions & 0 deletions charts/adcs-issuer/templates/adcsissuer-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: adcsissuers.adcs.certmanager.csf.nokia.com
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-
controller-gen.kubebuilder.io/version: v0.7.0
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
group: adcs.certmanager.csf.nokia.com
names:
kind: AdcsIssuer
listKind: AdcsIssuerList
plural: adcsissuers
singular: adcsissuer
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: AdcsIssuer is the Schema for the adcsissuers API
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:
description: AdcsIssuerSpec defines the desired state of AdcsIssuer
properties:
caBundle:
description: CABundle is a PEM encoded TLS certifiate to use to verify
connections to the ADCS server.
format: byte
type: string
credentialsRef:
description: CredentialsRef is a reference to a Secret containing the
username and password for the ADCS server. The secret must contain
two keys, 'username' and 'password'.
properties:
name:
description: Name of the referent.
type: string
required:
- name
type: object
retryInterval:
description: How often to retry in case of communication errors (in
time.ParseDuration() format) Default 1 hour.
type: string
statusCheckInterval:
description: How often to check for request status in the server (in
time.ParseDuration() format) Default 6 hours.
type: string
templateName:
description: Which ADCS Template should this issuer use Defaults to
the what is specified in main.go or as an cli option.
type: string
url:
description: URL is the base URL for the ADCS instance
type: string
required:
- credentialsRef
- url
type: object
status:
description: AdcsIssuerStatus defines the observed state of AdcsIssuer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
104 changes: 104 additions & 0 deletions charts/adcs-issuer/templates/adcsrequest-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: adcsrequests.adcs.certmanager.csf.nokia.com
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-
controller-gen.kubebuilder.io/version: v0.7.0
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
group: adcs.certmanager.csf.nokia.com
names:
kind: AdcsRequest
listKind: AdcsRequestList
plural: adcsrequests
singular: adcsrequest
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.state
name: State
type: string
name: v1
schema:
openAPIV3Schema:
description: AdcsRequest is the Schema for the adcsrequests API
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:
description: AdcsRequestSpec defines the desired state of AdcsRequest
properties:
csr:
description: Certificate signing request bytes in PEM encoding. This
will be used when finalizing the request. This field must be set on
the request.
format: byte
type: string
issuerRef:
description: IssuerRef references a properly configured AdcsIssuer which
should be used to serve this AdcsRequest. If the Issuer does not exist,
processing will be retried. If the Issuer is not an 'ADCS' Issuer,
an error will be returned and the ADCSRequest will be marked as failed.
properties:
group:
description: Group of the resource being referred to.
type: string
kind:
description: Kind of the resource being referred to.
type: string
name:
description: Name of the resource being referred to.
type: string
required:
- name
type: object
required:
- csr
- issuerRef
type: object
status:
description: AdcsRequestStatus defines the observed state of AdcsRequest
properties:
id:
description: ID of the Request assigned by the ADCS. This will initially
be empty when the resource is first created. The ADCSRequest controller
will populate this field when the Request is accepted by ADCS. This
field will be immutable after it is initially set.
type: string
reason:
description: Reason optionally provides more information about a why
the AdcsRequest is in the current state.
type: string
state:
description: State contains the current state of this ADCSRequest resource.
States 'ready' and 'rejected' are 'final'
enum:
- pending
- ready
- errored
- rejected
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "chart.fullname" . }}-cert-manager-controller-approve:adcs-certmanager-csf-nokia-com
labels:
{{- include "chart.labels" . | nindent 4 }}
rules:
- apiGroups:
- cert-manager.io
resourceNames:
- adcsissuers.adcs.certmanager.csf.nokia.com/*
- clusteradcsissuers.adcs.certmanager.csf.nokia.com/*
resources:
- signers
verbs:
- approve
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "chart.fullname" . }}-cert-manager-controller-approve:adcs-certmanager-csf-nokia-com
labels:
{{- include "chart.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "chart.fullname" . }}-cert-manager-controller-approve:adcs-certmanager-csf-nokia-com'
subjects:
- kind: ServiceAccount
name: '{{ include "chart.fullname" . }}-cert-manager'
namespace: '{{ .Release.Namespace }}'
Loading

0 comments on commit 82facaf

Please sign in to comment.