WIP: I'm already running the cluster in woodpecker, now I need to fix
the test
This commit is contained in:
		
							
								
								
									
										81
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										81
									
								
								.drone.yml
									
									
									
									
									
								
							@@ -1,4 +1,85 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
 | 
					kind: pipeline
 | 
				
			||||||
 | 
					type: docker
 | 
				
			||||||
 | 
					name: Lint the chart
 | 
				
			||||||
 | 
					trigger:
 | 
				
			||||||
 | 
					  event:
 | 
				
			||||||
 | 
					    - push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					environment:
 | 
				
			||||||
 | 
					  KIND_VERSION: v0.20.0
 | 
				
			||||||
 | 
					  HELM_VERSION: v3.12.1
 | 
				
			||||||
 | 
					  KUBECTL_VERSION: v1.28.3
 | 
				
			||||||
 | 
					  CT_VERSION: 3.10.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps:
 | 
				
			||||||
 | 
					  # ---------------------------------------------------------------------
 | 
				
			||||||
 | 
					  # -- Prepare dependencies
 | 
				
			||||||
 | 
					  # ---------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - name: Download dependencies
 | 
				
			||||||
 | 
					    image: ghcr.io/allanger/dumb-downloader:latest
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - mkdir .bin
 | 
				
			||||||
 | 
					      # -- Download kind
 | 
				
			||||||
 | 
					      - dudo -l "https://kind.sigs.k8s.io/dl/{{ version }}/kind-{{ os }}-{{ arch }}" -d .bin/kind -p $KIND_VERSION
 | 
				
			||||||
 | 
					      - chmod +x .bin/kind
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - name: Check changed charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: dockersock
 | 
				
			||||||
 | 
					        path: /var/run
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - export KUBECONFIG=$PWD/kubeconfig
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [[ -n "$(ct list-changed --chart-dirs . --target-branch main)" ]]; then
 | 
				
			||||||
 | 
					          touch .changed
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - name: Lint changed charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: dockersock
 | 
				
			||||||
 | 
					        path: /var/run
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [ -e .changed ]; then
 | 
				
			||||||
 | 
					        ct lint --target-branch main --validate-maintainers=false --chart-dirs .
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - name: Test changed charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: dockersock
 | 
				
			||||||
 | 
					        path: /var/run
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - export PATH=$PWD/.bin:$PATH
 | 
				
			||||||
 | 
					      - apk update && apk add docker
 | 
				
			||||||
 | 
					      - kind create cluster --config kind.yaml
 | 
				
			||||||
 | 
					      - sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config
 | 
				
			||||||
 | 
					      - kubectl get storageclass
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [ -e .changed ]; then
 | 
				
			||||||
 | 
					          ct install --target-branch main --chart-dirs .
 | 
				
			||||||
 | 
					          ct install --target-branch main --chart-dirs . --upgrade
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  - name: docker
 | 
				
			||||||
 | 
					    image: docker:dind
 | 
				
			||||||
 | 
					    privileged: true
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - name: dockersock
 | 
				
			||||||
 | 
					        path: /var/run
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  - name: dockersock
 | 
				
			||||||
 | 
					    temp: {}
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
# ----------------------------------------------
 | 
					# ----------------------------------------------
 | 
				
			||||||
# -- Build an image and push it to the registry
 | 
					# -- Build an image and push it to the registry
 | 
				
			||||||
# ----------------------------------------------
 | 
					# ----------------------------------------------
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								.woodpecker/.check-workflow.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								.woodpecker/.check-workflow.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					steps:
 | 
				
			||||||
 | 
					  deps:
 | 
				
			||||||
 | 
					    name: Download dependencies
 | 
				
			||||||
 | 
					    image: alpine
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - echo 1
 | 
				
			||||||
							
								
								
									
										2
									
								
								.woodpecker/.fail.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.woodpecker/.fail.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					steps: supersteps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										82
									
								
								.woodpecker/.test.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								.woodpecker/.test.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					clone:
 | 
				
			||||||
 | 
					  git:
 | 
				
			||||||
 | 
					    image: woodpeckerci/plugin-git
 | 
				
			||||||
 | 
					    settings:
 | 
				
			||||||
 | 
					      partial: false
 | 
				
			||||||
 | 
					steps:
 | 
				
			||||||
 | 
					  deps:
 | 
				
			||||||
 | 
					    name: Download dependencies
 | 
				
			||||||
 | 
					    image: ghcr.io/allanger/dumb-downloader:latest
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      KIND_VERSION: v0.20.0
 | 
				
			||||||
 | 
					      HELM_VERSION: v3.12.1
 | 
				
			||||||
 | 
					      KUBECTL_VERSION: v1.28.3
 | 
				
			||||||
 | 
					      CT_VERSION: 3.10.1
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - mkdir .bin
 | 
				
			||||||
 | 
					      # -- Download kind
 | 
				
			||||||
 | 
					      - dudo -l "https://kind.sigs.k8s.io/dl/{{ version }}/kind-{{ os }}-{{ arch }}" -d .bin/kind -p $KIND_VERSION
 | 
				
			||||||
 | 
					      - chmod +x .bin/kind
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  changed:
 | 
				
			||||||
 | 
					    name: Check changed charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - ls -la
 | 
				
			||||||
 | 
					      - ct help
 | 
				
			||||||
 | 
					      - ct lint --chart-dirs . --target-branch main --print-config --debug
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [[ -n "$(ct list-changed --chart-dirs . --target-branch main)" ]]; then
 | 
				
			||||||
 | 
					          touch .changed
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  lint:
 | 
				
			||||||
 | 
					    name: Lint charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [ -e .changed ]; then
 | 
				
			||||||
 | 
					          ct lint --target-branch main --validate-maintainers=false --chart-dirs .
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  test:
 | 
				
			||||||
 | 
					    name: Test charts
 | 
				
			||||||
 | 
					    image: quay.io/helmpack/chart-testing
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      - DOCKER_HOST=tcp://docker:2375
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - export PATH=$PWD/.bin:$PATH
 | 
				
			||||||
 | 
					      - apk update && apk add docker curl bash
 | 
				
			||||||
 | 
					      - curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
 | 
				
			||||||
 | 
					      - k3d cluster create test --api-port 16443 --k3s-arg="kubelet-args=\"--allowed-unsafe-sysctls=net.ipv4.ip_forward\""@all
 | 
				
			||||||
 | 
					      - sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config
 | 
				
			||||||
 | 
					      - kubectl get storageclass
 | 
				
			||||||
 | 
					      - git fetch origin
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        if [ -e .changed ]; then
 | 
				
			||||||
 | 
					          ct install --target-branch main --chart-dirs .
 | 
				
			||||||
 | 
					          ct install --target-branch main --chart-dirs . --upgrade
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  docker:
 | 
				
			||||||
 | 
					    image: docker:dind
 | 
				
			||||||
 | 
					    commands:
 | 
				
			||||||
 | 
					      - echo "1" >  /proc/sys/net/ipv4/ip_forward
 | 
				
			||||||
 | 
					      - dockerd -H tcp://0.0.0.0:2375 --tls=false
 | 
				
			||||||
 | 
					    privileged: true
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - 2375
 | 
				
			||||||
 | 
					      - 16443
 | 
				
			||||||
 | 
					    backend_options:
 | 
				
			||||||
 | 
					      kubernetes:
 | 
				
			||||||
 | 
					        resources:
 | 
				
			||||||
 | 
					          requests:
 | 
				
			||||||
 | 
					            memory: 500Mi
 | 
				
			||||||
 | 
					            cpu: 500m
 | 
				
			||||||
 | 
					          limits:
 | 
				
			||||||
 | 
					            memory: 1000Mi
 | 
				
			||||||
 | 
					            cpu: 1000m
 | 
				
			||||||
@@ -3,7 +3,7 @@ apiVersion: v2
 | 
				
			|||||||
name: openvpn
 | 
					name: openvpn
 | 
				
			||||||
description: A Helm chart for deploying OpenVPN
 | 
					description: A Helm chart for deploying OpenVPN
 | 
				
			||||||
type: application
 | 
					type: application
 | 
				
			||||||
version: 1.0.7
 | 
					version: 1.0.8
 | 
				
			||||||
appVersion: 2.6.5
 | 
					appVersion: 2.6.5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sources:
 | 
					sources:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,13 @@ metadata:
 | 
				
			|||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    {{- include "openvpn-chart.labels" . | nindent 4 }}
 | 
					    {{- include "openvpn-chart.labels" . | nindent 4 }}
 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
  storageClassName: {{ .Values.storage.class }}
 | 
					  {{- if .Values.storage.class }}
 | 
				
			||||||
 | 
					  {{- if (eq "-" .Values.storage.class) }}
 | 
				
			||||||
 | 
					  storageClassName: ""
 | 
				
			||||||
 | 
					  {{- else }}
 | 
				
			||||||
 | 
					  storageClassName: "{{ .Values.storage.class }}"
 | 
				
			||||||
 | 
					  {{- end }}
 | 
				
			||||||
 | 
					  {{- end }}
 | 
				
			||||||
  accessModes:
 | 
					  accessModes:
 | 
				
			||||||
    - ReadWriteOnce
 | 
					    - ReadWriteOnce
 | 
				
			||||||
  resources:
 | 
					  resources:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,6 @@ image:
 | 
				
			|||||||
  # -- TODO: Switch to proper versions
 | 
					  # -- TODO: Switch to proper versions
 | 
				
			||||||
  # -------------------------------------------
 | 
					  # -------------------------------------------
 | 
				
			||||||
  # tag: ""
 | 
					  # tag: ""
 | 
				
			||||||
 | 
					 | 
				
			||||||
# -----------------------------
 | 
					# -----------------------------
 | 
				
			||||||
# -- Open VPN configuration
 | 
					# -- Open VPN configuration
 | 
				
			||||||
# -----------------------------
 | 
					# -----------------------------
 | 
				
			||||||
@@ -24,24 +23,21 @@ openvpn_admin:
 | 
				
			|||||||
# -- Easy RSA configuration
 | 
					# -- Easy RSA configuration
 | 
				
			||||||
# -----------------------------
 | 
					# -----------------------------
 | 
				
			||||||
easyrsa:
 | 
					easyrsa:
 | 
				
			||||||
  cn: . # -- EASYRSA_REQ_CN
 | 
					  cn: .  # --  EASYRSA_REQ_CN
 | 
				
			||||||
  country: . # -- EASYRSA_REQ_COUNTRY
 | 
					  country: .  # --  EASYRSA_REQ_COUNTRY
 | 
				
			||||||
  province: . # -- EASYRSA_REQ_PROVINCE
 | 
					  province: .  # --  EASYRSA_REQ_PROVINCE
 | 
				
			||||||
  city: . # -- EASYRSA_REQ_CITY
 | 
					  city: .  # --  EASYRSA_REQ_CITY
 | 
				
			||||||
  org: . # -- EASYRSA_REQ_ORG
 | 
					  org: .  # --  EASYRSA_REQ_ORG
 | 
				
			||||||
  email: . # -- EASYRSA_REQ_EMAIL
 | 
					  email: .  # --  EASYRSA_REQ_EMAIL
 | 
				
			||||||
  ou: Community # -- EASYRSA_REQ_OU
 | 
					  ou: Community  # --  EASYRSA_REQ_OU
 | 
				
			||||||
  algo: ec # -- EASYRSA_ALGO
 | 
					  algo: ec  # --  EASYRSA_ALGO
 | 
				
			||||||
  digest: sha512 # -- EASYRSA_DIGEST 
 | 
					  digest: sha512  # --  EASYRSA_DIGEST
 | 
				
			||||||
 | 
					 | 
				
			||||||
replicaCount: 1
 | 
					replicaCount: 1
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
imagePullSecrets: []
 | 
					imagePullSecrets: []
 | 
				
			||||||
nameOverride: ""
 | 
					nameOverride: ""
 | 
				
			||||||
fullnameOverride: ""
 | 
					fullnameOverride: ""
 | 
				
			||||||
storage:
 | 
					storage:
 | 
				
			||||||
  class: local-path
 | 
					  class: ""
 | 
				
			||||||
  size: 1Gi
 | 
					  size: 1Gi
 | 
				
			||||||
serviceAccount:
 | 
					serviceAccount:
 | 
				
			||||||
  # Specifies whether a service account should be created
 | 
					  # Specifies whether a service account should be created
 | 
				
			||||||
@@ -51,36 +47,32 @@ serviceAccount:
 | 
				
			|||||||
  # The name of the service account to use.
 | 
					  # The name of the service account to use.
 | 
				
			||||||
  # If not set and create is true, a name is generated using the fullname template
 | 
					  # If not set and create is true, a name is generated using the fullname template
 | 
				
			||||||
  name: ""
 | 
					  name: ""
 | 
				
			||||||
 | 
					 | 
				
			||||||
podAnnotations: {}
 | 
					podAnnotations: {}
 | 
				
			||||||
 | 
					 | 
				
			||||||
podSecurityContext: {}
 | 
					podSecurityContext: {}
 | 
				
			||||||
  # fsGroup: 2000
 | 
					# fsGroup: 2000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
securityContext: {}
 | 
					securityContext: {}
 | 
				
			||||||
  # capabilities:
 | 
					# capabilities:
 | 
				
			||||||
  #   drop:
 | 
					#   drop:
 | 
				
			||||||
  #   - ALL
 | 
					#   - ALL
 | 
				
			||||||
  # readOnlyRootFilesystem: true
 | 
					# readOnlyRootFilesystem: true
 | 
				
			||||||
  # runAsNonRoot: true
 | 
					# runAsNonRoot: true
 | 
				
			||||||
  # runAsUser: 1000
 | 
					# runAsUser: 1000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
service:
 | 
					service:
 | 
				
			||||||
  type: ClusterIP
 | 
					  type: ClusterIP
 | 
				
			||||||
  port: 1194
 | 
					  port: 1194
 | 
				
			||||||
  protocol: TCP
 | 
					  protocol: TCP
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
resources: {}
 | 
					resources: {}
 | 
				
			||||||
  # We usually recommend not to specify default resources and to leave this as a conscious
 | 
					# We usually recommend not to specify default resources and to leave this as a conscious
 | 
				
			||||||
  # choice for the user. This also increases chances charts run on environments with little
 | 
					# choice for the user. This also increases chances charts run on environments with little
 | 
				
			||||||
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
 | 
					# resources, such as Minikube. If you do want to specify resources, uncomment the following
 | 
				
			||||||
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
 | 
					# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
 | 
				
			||||||
  # limits:
 | 
					# limits:
 | 
				
			||||||
  #   cpu: 100m
 | 
					#   cpu: 100m
 | 
				
			||||||
  #   memory: 128Mi
 | 
					#   memory: 128Mi
 | 
				
			||||||
  # requests:
 | 
					# requests:
 | 
				
			||||||
  #   cpu: 100m
 | 
					#   cpu: 100m
 | 
				
			||||||
#   memory: 128Mi
 | 
					#   memory: 128Mi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
autoscaling:
 | 
					autoscaling:
 | 
				
			||||||
@@ -89,13 +81,9 @@ autoscaling:
 | 
				
			|||||||
  maxReplicas: 100
 | 
					  maxReplicas: 100
 | 
				
			||||||
  targetCPUUtilizationPercentage: 80
 | 
					  targetCPUUtilizationPercentage: 80
 | 
				
			||||||
  # targetMemoryUtilizationPercentage: 80
 | 
					  # targetMemoryUtilizationPercentage: 80
 | 
				
			||||||
 | 
					 | 
				
			||||||
nodeSelector: {}
 | 
					nodeSelector: {}
 | 
				
			||||||
 | 
					 | 
				
			||||||
tolerations: []
 | 
					tolerations: []
 | 
				
			||||||
 | 
					 | 
				
			||||||
affinity: {}
 | 
					affinity: {}
 | 
				
			||||||
 | 
					 | 
				
			||||||
tests:
 | 
					tests:
 | 
				
			||||||
  enabled: false
 | 
					  enabled: false
 | 
				
			||||||
  cleanup: true
 | 
					  cleanup: true
 | 
				
			||||||
							
								
								
									
										21
									
								
								kind.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								kind.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					apiVersion: kind.x-k8s.io/v1alpha4
 | 
				
			||||||
 | 
					kind: Cluster
 | 
				
			||||||
 | 
					name: test
 | 
				
			||||||
 | 
					networking:
 | 
				
			||||||
 | 
					  apiServerAddress: "0.0.0.0"
 | 
				
			||||||
 | 
					  apiServerPort: 16443
 | 
				
			||||||
 | 
					kubeadmConfigPatches:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    kind: InitConfiguration
 | 
				
			||||||
 | 
					    nodeRegistration:
 | 
				
			||||||
 | 
					      kubeletExtraArgs:
 | 
				
			||||||
 | 
					          allowed-unsafe-sysctls: net.ipv4.ip_forward
 | 
				
			||||||
 | 
					nodes:
 | 
				
			||||||
 | 
					  - role: control-plane
 | 
				
			||||||
 | 
					    kubeadmConfigPatches:
 | 
				
			||||||
 | 
					      - |
 | 
				
			||||||
 | 
					        kind: ClusterConfiguration
 | 
				
			||||||
 | 
					        apiServer:
 | 
				
			||||||
 | 
					          certSANs:
 | 
				
			||||||
 | 
					          - "docker"
 | 
				
			||||||
 | 
					  - role: worker
 | 
				
			||||||
		Reference in New Issue
	
	Block a user