diff --git a/.zuul.yaml b/.zuul.yaml index affe955ee..346469f7a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -455,12 +455,12 @@ KURYR_K8S_API_URL: "https://{{ hostvars['controller-k8s']['nodepool']['private_ipv4'] }}:${KURYR_K8S_API_PORT}" KURYR_K8S_CONTAINERIZED_DEPLOYMENT: false KURYR_NEUTRON_DEFAULT_SUBNETPOOL_ID: shared-default-subnetpool-v4 - # TODO(YiFeng): At present, the version of kubernetes should be - # 1.23.3, and the returned response can pass the verification of - # kubernetes-client (1.23.3). This configuration will be removed - # after kuryr-kubernetes fixes the following bug. - # https://bugs.launchpad.net/kuryr-kubernetes/+bug/1968960 - KURYR_KUBERNETES_VERSION: 1.23.3 + # NOTES: + # - In Atelope cycle, Kubernetes version is updated to 1.25. + # https://blueprints.launchpad.net/tacker/+spec/update-k8s-helm-prometheus + KURYR_KUBERNETES_VERSION: 1.25.2 + CONTAINER_ENGINE: crio + CRIO_VERSION: 1.25 MYSQL_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}" OCTAVIA_AMP_IMAGE_FILE: "/tmp/test-only-amphora-x64-haproxy-ubuntu-bionic.qcow2" OCTAVIA_AMP_IMAGE_NAME: "test-only-amphora-x64-haproxy-ubuntu-bionic" @@ -520,7 +520,10 @@ amp_active_retries: 9999 kuryr_k8s_api_url: "https://{{ hostvars['controller-k8s']['nodepool']['private_ipv4'] }}:6443" k8s_ssl_verify: true - helm_version: "3.5.4" + # NOTES: + # - In Atelope cycle, Helm version is updated to 3.10. + # https://blueprints.launchpad.net/tacker/+spec/update-k8s-helm-prometheus + helm_version: "3.10.1" test_matrix_configs: [neutron] zuul_work_dir: src/opendev.org/openstack/tacker zuul_copy_output: diff --git a/devstack/local.conf.kubernetes b/devstack/local.conf.kubernetes index 23a3da030..ec3d1e36e 100644 --- a/devstack/local.conf.kubernetes +++ b/devstack/local.conf.kubernetes @@ -60,8 +60,15 @@ enable_service n-cauth disable_service tempest -# Enable kuryr-kubernetes, docker, octavia +# Enable kuryr-kubernetes, crio, octavia KUBERNETES_VIM=True +# It is necessary to specify the patch version +# because it is the version used when executing "apt-get install" command. +KURYR_KUBERNETES_VERSION="1.25.2" +CONTAINER_ENGINE="crio" +# It is not necessary to specify the patch version +# because it is the version used when adding the apt repository. +CRIO_VERSION="1.25" enable_plugin kuryr-kubernetes https://opendev.org/openstack/kuryr-kubernetes master enable_plugin octavia https://opendev.org/openstack/octavia master enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container master diff --git a/playbooks/devstack/pre.yaml b/playbooks/devstack/pre.yaml index 20a8abbbd..034b4961c 100644 --- a/playbooks/devstack/pre.yaml +++ b/playbooks/devstack/pre.yaml @@ -1,6 +1,7 @@ - hosts: all roles: - ensure-db-cli-installed + - setup-k8s-nodes - orchestrate-devstack - modify-heat-policy - setup-k8s-oidc diff --git a/roles/setup-default-vim/files/create_admin_token.yaml b/roles/setup-default-vim/files/create_admin_token.yaml index 07060e923..c78217537 100644 --- a/roles/setup-default-vim/files/create_admin_token.yaml +++ b/roles/setup-default-vim/files/create_admin_token.yaml @@ -20,4 +20,13 @@ metadata: namespace: kube-system labels: kubernetes.io/cluster-service: "true" - addonmanager.kubernetes.io/mode: Reconcile \ No newline at end of file + addonmanager.kubernetes.io/mode: Reconcile +--- +apiVersion: v1 +kind: Secret +metadata: + name: admin-token-k8svim + namespace: kube-system + annotations: + kubernetes.io/service-account.name: "admin" +type: kubernetes.io/service-account-token diff --git a/roles/setup-k8s-nodes/tasks/main.yaml b/roles/setup-k8s-nodes/tasks/main.yaml new file mode 100644 index 000000000..2b7becfb5 --- /dev/null +++ b/roles/setup-k8s-nodes/tasks/main.yaml @@ -0,0 +1,24 @@ +- block: + - name: load kernel module + modprobe: + name: "{{ item }}" + state: present + with_items: + - overlay + - br_netfilter + become: yes + - name: configure network(iptables/ip_forward) kernel parameter + sysctl: + name: "{{ item }}" + value: '1' + sysctl_set: yes + state: present + reload: yes + with_items: + - net.bridge.bridge-nf-call-ip6tables + - net.bridge.bridge-nf-call-iptables + - net.ipv4.ip_forward + become: yes + when: + - inventory_hostname == 'controller-k8s' + - kuryr_k8s_api_url is defined diff --git a/roles/setup-k8s-oidc/files/create_keycloak.sh b/roles/setup-k8s-oidc/files/create_keycloak.sh index d354f53bc..1235bf998 100644 --- a/roles/setup-k8s-oidc/files/create_keycloak.sh +++ b/roles/setup-k8s-oidc/files/create_keycloak.sh @@ -1,6 +1,6 @@ #!/bin/bash -docker run -d \ +podman run -d \ --net=host \ -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \ -e KC_HTTP_PORT=8080 -e KC_HTTPS_PORT=8443 \ diff --git a/tacker/tests/etc/samples/etsi/nfv/test_cnf/Files/kubernetes/horizontal-pod-autoscaler.yaml b/tacker/tests/etc/samples/etsi/nfv/test_cnf/Files/kubernetes/horizontal-pod-autoscaler.yaml index 53b8d9113..14aee5f29 100644 --- a/tacker/tests/etc/samples/etsi/nfv/test_cnf/Files/kubernetes/horizontal-pod-autoscaler.yaml +++ b/tacker/tests/etc/samples/etsi/nfv/test_cnf/Files/kubernetes/horizontal-pod-autoscaler.yaml @@ -7,7 +7,7 @@ spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: - apiVersion: extensions/v1beta1 + apiVersion: apps/v1 kind: Deployment name: curry-svc-vdu001 targetCPUUtilizationPercentage: 40 diff --git a/tacker/tests/etc/samples/etsi/nfv/test_cnf/TOSCA-Metadata/TOSCA.meta b/tacker/tests/etc/samples/etsi/nfv/test_cnf/TOSCA-Metadata/TOSCA.meta index 6d590c695..a049e1aa3 100644 --- a/tacker/tests/etc/samples/etsi/nfv/test_cnf/TOSCA-Metadata/TOSCA.meta +++ b/tacker/tests/etc/samples/etsi/nfv/test_cnf/TOSCA-Metadata/TOSCA.meta @@ -36,7 +36,7 @@ Hash: 80f160c9bdd9daa6d0111c8d40b5575946b8c0f23696aa8d91d20f313adae087 Name: Files/kubernetes/horizontal-pod-autoscaler.yaml Content-Type: test-data Algorithm: SHA-256 -Hash: aa95058d04ef61159712e7c567220b3f5c275251d78b0000bc04575f23c55894 +Hash: e0fcd3fe107ede4c21d436afbc28455a9c60909bf67f27886c88b379ca529e09 Name: Files/kubernetes/job.yaml Content-Type: test-data diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart-0.1.1.tgz b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart-0.1.1.tgz index 43ab2841d..3d81b688a 100644 Binary files a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart-0.1.1.tgz and b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart-0.1.1.tgz differ diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/NOTES.txt b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/NOTES.txt index 8e5bcb8f5..1fd1f2b6a 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/NOTES.txt +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/NOTES.txt @@ -1,11 +1,5 @@ 1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "test-chart.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml index 80016074f..d3f7a31cd 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml @@ -5,9 +5,7 @@ metadata: labels: {{- include "test-chart.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCountVdu1 }} - {{- end }} selector: matchLabels: {{- include "test-chart.selectorLabels" . | nindent 6 }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml index bb7b75855..9c4585dd6 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml @@ -5,9 +5,7 @@ metadata: labels: {{- include "test-chart.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCountVdu2 }} - {{- end }} selector: matchLabels: {{- include "test-chart.selectorLabels" . | nindent 6 }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/hpa.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/hpa.yaml deleted file mode 100644 index cb4594c59..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "test-chart.fullname" . }} - labels: - {{- include "test-chart.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "test-chart.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/ingress.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/ingress.yaml deleted file mode 100644 index 6cf62cee3..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "test-chart.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "test-chart.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml deleted file mode 100644 index 436cd35e6..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "test-chart.fullname" . }}-test-connection" - labels: - {{- include "test-chart.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "test-chart.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/values.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/values.yaml index ce8bf1740..5a9ba0961 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/values.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/Files/kubernetes/test-chart/values.yaml @@ -41,22 +41,6 @@ service: type: ClusterIP port: 80 -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} # 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 @@ -69,13 +53,6 @@ resources: {} # cpu: 100m # memory: 128Mi -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - nodeSelector: {} tolerations: [] diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/TOSCA-Metadata/TOSCA.meta b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/TOSCA-Metadata/TOSCA.meta index 53d6cba01..f1dffaffb 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/TOSCA-Metadata/TOSCA.meta +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_change_vnf_pkg/contents/TOSCA-Metadata/TOSCA.meta @@ -6,4 +6,4 @@ Entry-Definitions: Definitions/sample_cnf_top.vnfd.yaml Name: Files/kubernetes/test-chart-0.1.1.tgz Content-Type: test-data Algorithm: SHA-256 -Hash: 0af8bdd875d80896585e75f55b7fda2d291a8152e49f26816203d7d94bcdfe9f +Hash: 388dbd7b96024d9800de46dfdf9b2a9c829e9d74f256321727170d28eff2fd8b diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart-0.1.0.tgz b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart-0.1.0.tgz index 2d2e2b1b2..8a447dc23 100644 Binary files a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart-0.1.0.tgz and b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart-0.1.0.tgz differ diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/NOTES.txt b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/NOTES.txt index 8e5bcb8f5..1fd1f2b6a 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/NOTES.txt +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/NOTES.txt @@ -1,11 +1,5 @@ 1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "test-chart.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml index 80016074f..d3f7a31cd 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu1.yaml @@ -5,9 +5,7 @@ metadata: labels: {{- include "test-chart.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCountVdu1 }} - {{- end }} selector: matchLabels: {{- include "test-chart.selectorLabels" . | nindent 6 }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml index a10e6af4c..b76b5daf2 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/deployment_vdu2.yaml @@ -5,9 +5,7 @@ metadata: labels: {{- include "test-chart.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCountVdu2 }} - {{- end }} selector: matchLabels: {{- include "test-chart.selectorLabels" . | nindent 6 }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/hpa.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/hpa.yaml deleted file mode 100644 index cb4594c59..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "test-chart.fullname" . }} - labels: - {{- include "test-chart.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "test-chart.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/ingress.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/ingress.yaml deleted file mode 100644 index 6cf62cee3..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "test-chart.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "test-chart.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml deleted file mode 100644 index 436cd35e6..000000000 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "test-chart.fullname" . }}-test-connection" - labels: - {{- include "test-chart.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "test-chart.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/values.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/values.yaml index ce8bf1740..5a9ba0961 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/values.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/Files/kubernetes/test-chart/values.yaml @@ -41,22 +41,6 @@ service: type: ClusterIP port: 80 -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - resources: {} # 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 @@ -69,13 +53,6 @@ resources: {} # cpu: 100m # memory: 128Mi -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - nodeSelector: {} tolerations: [] diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/TOSCA-Metadata/TOSCA.meta b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/TOSCA-Metadata/TOSCA.meta index 231b8041a..23e7d736e 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/TOSCA-Metadata/TOSCA.meta +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_helm_instantiate/contents/TOSCA-Metadata/TOSCA.meta @@ -6,4 +6,4 @@ Entry-Definitions: Definitions/sample_cnf_top.vnfd.yaml Name: Files/kubernetes/test-chart-0.1.0.tgz Content-Type: test-data Algorithm: SHA-256 -Hash: 96851c4f3e566d7e94eaa3f7a6ada7fcede501316ffc35b0e27bfdab7f23d4fc +Hash: fa05dd35f45adb43ff1c6c77675ac82c477c5a55a3ad14a87a6b542c21cf4f7c diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/Files/kubernetes/horizontal-pod-autoscaler.yaml b/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/Files/kubernetes/horizontal-pod-autoscaler.yaml index 53b8d9113..14aee5f29 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/Files/kubernetes/horizontal-pod-autoscaler.yaml +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/Files/kubernetes/horizontal-pod-autoscaler.yaml @@ -7,7 +7,7 @@ spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: - apiVersion: extensions/v1beta1 + apiVersion: apps/v1 kind: Deployment name: curry-svc-vdu001 targetCPUUtilizationPercentage: 40 diff --git a/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/TOSCA-Metadata/TOSCA.meta b/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/TOSCA-Metadata/TOSCA.meta index 64336fdbf..744f31dcc 100644 --- a/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/TOSCA-Metadata/TOSCA.meta +++ b/tacker/tests/functional/sol_kubernetes_v2/samples/test_instantiate_cnf_resources/contents/TOSCA-Metadata/TOSCA.meta @@ -41,7 +41,7 @@ Hash: 2a83656567410141fb50086cdd3e73bd9fb9721bee444872c22338258dd076e0 Name: Files/kubernetes/horizontal-pod-autoscaler.yaml Content-Type: test-data Algorithm: SHA-256 -Hash: aa95058d04ef61159712e7c567220b3f5c275251d78b0000bc04575f23c55894 +Hash: e0fcd3fe107ede4c21d436afbc28455a9c60909bf67f27886c88b379ca529e09 Name: Files/kubernetes/job.yaml Content-Type: test-data diff --git a/tacker/tests/unit/sol_refactored/samples/sample2/Files/kubernetes/horizontal-pod-autoscaler.yaml b/tacker/tests/unit/sol_refactored/samples/sample2/Files/kubernetes/horizontal-pod-autoscaler.yaml index 53b8d9113..14aee5f29 100644 --- a/tacker/tests/unit/sol_refactored/samples/sample2/Files/kubernetes/horizontal-pod-autoscaler.yaml +++ b/tacker/tests/unit/sol_refactored/samples/sample2/Files/kubernetes/horizontal-pod-autoscaler.yaml @@ -7,7 +7,7 @@ spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: - apiVersion: extensions/v1beta1 + apiVersion: apps/v1 kind: Deployment name: curry-svc-vdu001 targetCPUUtilizationPercentage: 40 diff --git a/tacker/tests/unit/sol_refactored/samples/sample2/TOSCA-Metadata/TOSCA.meta b/tacker/tests/unit/sol_refactored/samples/sample2/TOSCA-Metadata/TOSCA.meta index 995a16f14..32b693abf 100644 --- a/tacker/tests/unit/sol_refactored/samples/sample2/TOSCA-Metadata/TOSCA.meta +++ b/tacker/tests/unit/sol_refactored/samples/sample2/TOSCA-Metadata/TOSCA.meta @@ -41,7 +41,7 @@ Hash: f8ed04536a8795af4828b2f731225abc34986f9ea30237d9652669ca57d9d217 Name: Files/kubernetes/horizontal-pod-autoscaler.yaml Content-Type: test-data Algorithm: SHA-256 -Hash: aa95058d04ef61159712e7c567220b3f5c275251d78b0000bc04575f23c55894 +Hash: e0fcd3fe107ede4c21d436afbc28455a9c60909bf67f27886c88b379ca529e09 Name: Files/kubernetes/job.yaml Content-Type: test-data diff --git a/tacker/tests/unit/vnfm/infra_drivers/kubernetes/kubernetes_api_resource/horizontal-pod-autoscaler.yaml b/tacker/tests/unit/vnfm/infra_drivers/kubernetes/kubernetes_api_resource/horizontal-pod-autoscaler.yaml index d185fddd2..e51c38a5d 100644 --- a/tacker/tests/unit/vnfm/infra_drivers/kubernetes/kubernetes_api_resource/horizontal-pod-autoscaler.yaml +++ b/tacker/tests/unit/vnfm/infra_drivers/kubernetes/kubernetes_api_resource/horizontal-pod-autoscaler.yaml @@ -7,7 +7,7 @@ spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: - apiVersion: extensions/v1beta1 + apiVersion: apps/v1 kind: Deployment name: curry-svc-vdu001 targetCPUUtilizationPercentage: 40 diff --git a/tools/gen_vim_config.sh b/tools/gen_vim_config.sh index 99f5c8839..87fb5380a 100755 --- a/tools/gen_vim_config.sh +++ b/tools/gen_vim_config.sh @@ -30,6 +30,20 @@ VIMC_DEFAULT_OUTPUT=vim_config.yaml # Secret token retrieved from kubectl. ####################################### function k8s_token() { + # NOTES: + # - Service account tokens are no longer automatically generated + # for each ServiceAccount in Kubernetes 1.24, + # so it is necessary to manually register Secret. + kubectl create -f - </dev/null +apiVersion: v1 +kind: Secret +metadata: + name: default-token-k8svim + annotations: + kubernetes.io/service-account.name: "default" +type: kubernetes.io/service-account-token +EOF + local _secret=$(kubectl get secret -o jsonpath="{.items[0].metadata.name}") echo $(kubectl get secret ${_secret} -o jsonpath="{.data.token}" | base64 --decode)